本文整理汇总了PHP中KLogger类的典型用法代码示例。如果您正苦于以下问题:PHP KLogger类的具体用法?PHP KLogger怎么用?PHP KLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KLogger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construction for class
*
* @param string $sourceFolder : end with slash '/'
* @param string $sourceName
* @param string $destFolder : end with slash '/'
* @param string $destName
* @param int $maxWidth
* @param int $maxHeight
* @param string $cropRatio
* @param int $quality
* @param string $color
*
* @return ImageResizer
*/
function __construct($sourceFolder, $sourceName, $destFolder, $destName, $maxWidth = 0, $maxHeight = 0, $cropRatio = '', $quality = 90, $color = '')
{
$this->sourceFolder = $sourceFolder;
$this->sourceName = $sourceName;
$this->destFolder = $destFolder;
$this->destName = $destName;
$this->maxWidth = $maxWidth;
$this->maxHeight = $maxHeight;
$this->cropRatio = $cropRatio;
$this->quality = $quality;
$this->color = $color;
$klog = new KLogger(Yii::getPathOfAlias('common.log') . DIRECTORY_SEPARATOR . 'resize_image_log', KLogger::INFO);
if (!file_exists($this->sourceFolder . $this->sourceName)) {
echo 'Error: image does not exist: ' . $this->sourceFolder . $this->sourceName;
$this->file_error = true;
$klog->LogInfo('Error: image does not exist: ' . $this->sourceFolder . $this->sourceName);
return null;
}
$size = GetImageSize($this->sourceFolder . $this->sourceName);
$mime = $size['mime'];
// Make sure that the requested file is actually an image
if (substr($mime, 0, 6) != 'image/') {
echo 'Error: requested file is not an accepted type: ' . $this->sourceFolder . $this->sourceName;
$klog->LogInfo('Error: requested file is not an accepted type: ' . $this->sourceFolder . $this->sourceName);
$this->file_error = true;
return null;
}
$this->size = $size;
if ($color != '') {
$this->color = preg_replace('/[^0-9a-fA-F]/', '', $color);
} else {
$this->color = FALSE;
}
}
开发者ID:nganhtuan63,项目名称:gxc-app,代码行数:49,代码来源:ImageResizer.php
示例2: logQuery
/**
* Führt eine SQL Query aus und schreibt sie in die Logdatei.
* @param KLogger $log Logdatei Objekt
* @param rex_sql $sql SQL Objekt
* @param String $query SQL Query
*/
public static function logQuery(&$log, &$sql, $query)
{
$sql->setQuery($query);
if ($sql->getError() == '') {
$log->logInfo('>> [QRY] ' . htmlentities($query));
} else {
$log->logError('>> [QRY] ' . htmlentities($query));
$log->logError('>> [QRY] ' . $sql->getError());
}
}
开发者ID:TobiasKrais,项目名称:d2u_stellenmarkt,代码行数:16,代码来源:class.rex_hr4you_sync_utils.inc.php
示例3: __construct
/**
* Initialize project by calling get_config on the RW server and saving the response.
*
* @param int $id PK of a project
* @throws Exception if valid config objects (device, session, project) are not returned from RW
*/
function __construct(array $config = array())
{
$this->CI =& get_instance();
$this->log = KLogger::syslog(KLogger::DEBUG, TRUE);
if (isset($config['id'])) {
$this->project_id = $config['id'];
}
// if we don't have an RW session-id, call get config and push the device and project
// values into the CI session. If we do have an RW session-id, pull those values
// from the CI session.
if (FALSE === ($this->rw_session_id = $this->CI->session->userdata('rw_session_id'))) {
$this->config(json_decode($this->do_curl('get_config')));
$this->CI->session->set_userdata('rw_session_id', $this->rw_session_id);
$this->CI->session->set_userdata('rw_device', $this->device);
$this->CI->session->set_userdata('rw_project', $this->project);
} else {
$this->rw_session_id = $this->CI->session->userdata('rw_session_id');
$this->device = $this->CI->session->userdata('rw_device');
$this->project = $this->CI->session->userdata('rw_project');
}
// we can't do anything without device, session and project objects
if (!($this->device && $this->rw_session_id && $this->project)) {
throw new Exception("Roundware could not be initialized with the given project ID.");
}
}
开发者ID:radishpower,项目名称:roundware,代码行数:31,代码来源:Roundware.php
示例4: lost
public function lost()
{
$log = KLogger::instance(KLOGGER_PATH . "processors/", KLogger::DEBUG);
$log->logInfo("usergameaction > lost > start userId : " . $this->userId . " opponentId : " . $this->opponentId . " action : " . $this->action_ . " time : " . $this->time . " room groupId : " . $this->roomGroupId . " gameId : " . $this->gameId . " normal : " . $this->normal . " type : " . $this->type . " double : " . $this->double);
if (!empty($this->userId)) {
$user = GameUsers::getGameUserById($this->userId);
if (!empty($user)) {
$userId = $user->getUserId();
if (!empty($userId)) {
$user->getUserLevel();
$opponent = GameUsers::getGameUserById($this->opponentId);
$opponentId = null;
if (!empty($opponent)) {
$opponentId = $opponent->getUserId();
$opponent->getUserLevel();
}
$result = GameUtils::gameResult($user, $opponent, $this->roomGroupId, $this->action_, $this->gameId, $this->double, $this->normal, $this->type, $this->time);
if (!empty($result) && $result->success) {
$log->logInfo("usergameaction > lost > success ");
} else {
$log->logError("usergameaction > lost > error : " . $result->result);
}
unset($userId);
unset($user);
} else {
$log->logError("usergameaction > lost > user Id is empty ");
}
} else {
$log->logError("usergameaction > lost > user Id is empty ");
}
} else {
$log->logError("usergameaction > lost > user Id is empty ");
}
}
开发者ID:bsormagec,项目名称:tavlamania-php,代码行数:34,代码来源:usergameaction.class.php
示例5: log
public function log()
{
$log = KLogger::instance(KLOGGER_PATH . "processors/", KLogger::DEBUG);
$log->logInfo("userxplog > log > start userId : " . $this->userId . " xp : " . $this->xp . " type : " . $this->type . " time : " . $this->time . " gameId : " . $this->gameId . " result : " . $this->result . " opponentId : " . $this->opponentId);
if (!empty($this->userId)) {
$userXPLog = new GameUserXpLog();
$userXPLog->setUserId($this->userId);
$userXPLog->setXp($this->xp);
$userXPLog->setTime($this->time);
$userXPLog->setType($this->type);
$userXPLog->setGameId($this->gameId);
$userXPLog->setResult($this->result);
$userXPLog->setOpponentId($this->opponentId);
try {
$user = GameUsers::getGameUserById($this->userId);
if (!empty($user)) {
$userXPLog->setUserLevel($user->userLevelNumber);
$userXPLog->setUserCoin($user->coins);
//$userCoinLog->setUserSpentCoin($user->opponentId);
}
} catch (Exception $exc) {
$log->logError("userxplog > log > User Error : " . $exc->getTraceAsString());
}
try {
$userXPLog->insertIntoDatabase(DBUtils::getConnection());
$log->logInfo("userxplog > log > Success");
} catch (Exception $exc) {
$log->logError("userxplog > log > Error : " . $exc->getTraceAsString());
}
} else {
$log->logError("userxplog > log > user Id is empty ");
}
}
开发者ID:bsormagec,项目名称:tavlamania-php,代码行数:33,代码来源:userxplog.class.php
示例6: __construct
public function __construct()
{
date_default_timezone_set("PRC");
self::$log = \KLogger::instance(dirname(__FILE__) . "/../log", \KLogger::DEBUG);
require_once '../config/Config.php';
$this->config = $METAQ_CONFIG;
$this->initPartitionList();
}
开发者ID:jnan77,项目名称:metaq-php,代码行数:8,代码来源:MetaQ.php
示例7: __construct
public function __construct($config)
{
if ($config['logging']['enabled'] && $config['logging']['level'] > 0) {
$this->KLogger = KLogger::instance($config['logging']['path'] . '/website', $config['logging']['level']);
$this->logging = true;
$this->floatStartTime = microtime(true);
}
}
开发者ID:ed-ro0t,项目名称:php-mpos,代码行数:8,代码来源:logger.class.php
示例8: __construct
public function __construct($class = "GLOBAL", $user = "_UKRAINE_", $prefix = "")
{
global $LOGS_PATH;
global $LOGS_SEVERITY;
if (!isset(Logger::$log)) {
Logger::$log = KLogger::instance($LOGS_PATH, $LOGS_SEVERITY);
}
$this->class = $class;
$this->user = $user;
$this->prefix = $prefix;
}
开发者ID:ntoskrnl,项目名称:ukraine,代码行数:11,代码来源:logger.php
示例9: saveMIDItoFile
public function saveMIDItoFile()
{
//$this->filename = base_convert(mt_rand(), 10, 36);
if($this->filenameSet === true)
{
$this->midi->saveMidFile($this->filepath.'.mid', 0666);
if (defined('DEBUG')) $log = KLogger::instance(dirname(DEBUG), KLogger::DEBUG);
if (defined('DEBUG')) $log->logInfo("Saved MIDI to file: $this->filepath");
return true;
}
}
开发者ID:niieani,项目名称:nandu,代码行数:11,代码来源:MIDIfy.php
示例10: generateAudio
public function generateAudio($filepath)
{
//we could also make use of FIFOs:
//http://stackoverflow.com/questions/60942/how-can-i-send-the-stdout-of-one-process-to-multiple-processes-using-preferably
$command = '/usr/bin/timidity -A110 -Ow --verbose=-2 --reverb=f,100 --output-file=- '.$filepath.'.mid | tee >(lame --silent -V6 - '.$filepath.'.mp3) | oggenc -Q -q1 -o '.$filepath.'.ogg -';
//file_put_contents('command', $command);
if (defined('ASYNCHRONOUS_LAUNCH')) $this->launchBackgroundProcess('/bin/bash -c "'.$command.'"');
else shell_exec('/bin/bash -c "'.$command.'"');
if (defined('DEBUG')) $log = KLogger::instance(dirname(DEBUG), KLogger::DEBUG);
if (defined('DEBUG')) $log->logInfo("Converted MIDI to audio files with the command: $command");
return true;
}
开发者ID:niieani,项目名称:nandu,代码行数:13,代码来源:AuralizeNumbers.php
示例11: __construct
public function __construct($template, $action, $urlValues, $standalone = false, $signinRequired = false)
{
$this->action = $action;
$this->urlValues = $urlValues;
$this->template = $template;
$this->_standalone = $standalone;
$this->log = KLogger::instance(KLOGGER_PATH, KLogger::DEBUG);
$this->language = LANG_TR_TR;
if (!isset($_SESSION)) {
session_start();
}
if ($signinRequired) {
$this->redirect("/");
}
}
开发者ID:bsormagec,项目名称:tavlamania-php,代码行数:15,代码来源:basecontroller.php
示例12: updateImage
public function updateImage()
{
$log = KLogger::instance(KLOGGER_PATH . "processors/", KLogger::DEBUG);
$log->logInfo("user > updateImage > start userId : " . $this->userId);
try {
$userId = $this->userId;
if (!empty($userId)) {
$result = UserProfileImageUtils::updateUserImage($userId);
$log->logInfo("user > updateImage >userId : " . $this->userId . " Result " . json_encode($result));
} else {
$log->logError("user > updateImage > start userId : " . $this->userId . " user found user id empty");
}
} catch (Exception $exc) {
$log->logError("user > updateImage > error userId : " . $this->userId . " Error :" . $exc->getMessage());
}
$log->logInfo("user > updateImage > finished userId : " . $this->userId);
}
开发者ID:bsormagec,项目名称:tavlamania-php,代码行数:17,代码来源:user.class.php
示例13: KLogger
#!/usr/bin/php
<?php
// read mails from internal bounce mailbox and set invalidEmail=1 for these email addresses
require '/var/www/yoursite/http/variables.php';
require '/var/www/yoursite/http/variablesdb.php';
require_once '/var/www/yoursite/http/functions.php';
require '/var/www/yoursite/http/log/KLogger.php';
$log = new KLogger('/var/www/yoursite/http/log/bounces/', KLogger::INFO);
$mailbox = imap_open('{localhost:993/ssl/novalidate-cert}', 'bounce', 'bounce01$');
$mailbox_info = imap_check($mailbox);
for ($i = 1; $i <= $mailbox_info->Nmsgs; $i++) {
$msg = imap_fetch_overview($mailbox, $i);
$rcpt = $msg[0]->to;
if (substr($rcpt, 0, 6) == 'bounce') {
$target = substr($rcpt, 7);
// exclude 'bounce='
$target = substr($target, 0, -9);
// exclude '@yoursite'
$target = str_replace('=', '@', $target);
// revert '=' to '@'
if ($msg[0]->answered == 0) {
$sql = "UPDATE {$playerstable} SET invalidEmail=1 WHERE invalidEmail=0 AND mail='" . $target . "'";
mysql_query($sql);
$affected = mysql_affected_rows();
$uid = imap_uid($mailbox, $i);
$status = imap_setflag_full($mailbox, $uid, '\\Answered \\Seen', ST_UID);
$log->logInfo('sql=[' . $sql . '] affected=[' . $affected . '] status=[' . $status . ']');
}
}
}
imap_close($mailbox);
开发者ID:kinj1987,项目名称:evo-league,代码行数:31,代码来源:bounces.php
示例14: setDateFormat
/**
* Sets the date format used by all instances of KLogger
*
* @param string $dateFormat Valid format string for date()
*/
public static function setDateFormat($dateFormat)
{
self::$_dateFormat = $dateFormat;
}
开发者ID:TobiasKrais,项目名称:d2u_stellenmarkt,代码行数:9,代码来源:class.klogger.inc.php
示例15: KLogger
#!/usr/bin/php
<?php
require '/var/www/yoursite/http/variables.php';
require '/var/www/yoursite/http/variablesdb.php';
require_once '/var/www/yoursite/cron/functions.php';
require '/var/www/yoursite/http/log/KLogger.php';
$log = new KLogger('/var/www/yoursite/http/log/cron/', KLogger::INFO);
// PES
$log->logInfo('runDaily: start');
// delete old log entries
$sql = "DELETE FROM weblm_log_access WHERE accesstime < ( UNIX_TIMESTAMP( ) - (60*60*24*180))";
mysql_query($sql);
$log->logInfo('runDaily: Deleted old log entries: ' . mysql_affected_rows());
// send email with played games to all users that selected this in their profile
$dateday = date("d/m/Y");
$yesterday = date("d/m/Y", time() - 60 * 60 * 12);
$timespan = 60 * 60 * 24;
$playersquery = "select distinct winner from {$gamestable} where deleted='no' " . "AND dateday = '{$yesterday}' " . "UNION " . "select distinct winner2 from {$gamestable} where deleted='no' " . "AND dateday = '{$yesterday}' " . "UNION " . "select distinct loser from {$gamestable} where deleted='no' " . "AND dateday = '{$yesterday}' " . "UNION " . "select distinct loser2 from {$gamestable} where deleted='no' " . "AND dateday = '{$yesterday}' ";
$result = mysql_query($playersquery);
$playerscount = mysql_num_rows($result);
$adminMessage = "";
$sql_total = "select count(*) AS c from {$gamestable} " . "WHERE deleted = 'no' " . "AND dateday = '{$yesterday}' " . "ORDER BY date DESC";
$res_total = mysql_query($sql_total);
$row_total = mysql_fetch_array($res_total);
$count_total = $row_total['c'];
$sql_deleted = "select count(*) AS c from {$gamestable} " . "WHERE deleted = 'yes' " . "AND dateday = '{$yesterday}' " . "ORDER BY date DESC";
$res_deleted = mysql_query($sql_deleted);
$row_deleted = mysql_fetch_array($res_deleted);
$count_deleted = $row_deleted['c'];
while ($row = mysql_fetch_array($result)) {
// for each player that played do...
开发者ID:kinj1987,项目名称:evo-league,代码行数:31,代码来源:runDaily.php
示例16: actionIndex
public function actionIndex()
{
$urlKey = Yii::app()->request->getParam('url_key');
$urlKey = preg_replace("/^\\.+|\\.+\$/", "", trim($urlKey));
$sql = "select * from ads_marketing where url_key=:url_key limit 1";
$cm = Yii::app()->db->createCommand($sql);
$cm->bindParam(':url_key', $urlKey, PDO::PARAM_STR);
$ads = $cm->queryRow();
if ($ads) {
$userPhone = Yii::app()->user->getState('msisdn');
$userSub = $this->isSub;
$source = $ads['code'];
Yii::app()->session['source'] = $source;
if ($source == 'ADS') {
Yii::app()->session['src'] = 'ads';
}
//log ads
$write = 1;
if (isset($_SESSION[$source])) {
// check time giua 2 lan visit co > 15 giay hay ko
$latest_time = $_SESSION[$source];
$now = date("Y-m-d H:i:s");
$diff = strtotime($now) - strtotime($latest_time);
if (intval($diff) < 15) {
$write = 0;
}
}
if ($write == 1) {
// log to table log_ads_click
$log = new LogAdsClickModel();
$ip = $_SERVER["REMOTE_ADDR"];
$is3G = 0;
if ($this->is3g) {
$is3G = 1;
}
//$log->logAdsWap($userPhone, $source, $ip, $is3G);
$log->ads = $source;
$log->user_phone = $userPhone;
$log->user_ip = $ip;
$log->is_3g = $is3G;
$log->created_time = date("Y-m-d H:i:s");
$log->save(false);
// set session value
$_SESSION[$source] = date("Y-m-d H:i:s");
}
//end log
$destLink = $ads['dest_link'];
if ($userSub || empty($userPhone)) {
$this->redirect($destLink);
}
$logger = new KLogger("log_sl", KLogger::INFO);
$logger->LogInfo("action:" . $ads['action'] . "|userSub:" . json_encode($userSub), false);
if ($ads['action'] == 'subscribe' && !$userSub) {
//subscribe now
$this->showPopupKm = false;
$this->showPopup = false;
$userPackage = UserSubscribeModel::model()->get($userPhone);
$package_id = $ads['package_id'];
$packageCode = PackageModel::model()->findByPk($package_id)->code;
if (empty($userPackage)) {
//doregister
$url = Yii::app()->createUrl('account/vasRegister', array('package' => $package_id, 'back_link' => $destLink));
$this->redirect($url);
}
}
$this->redirect($destLink);
} else {
$this->redirect('http://amusic.vn');
}
}
开发者ID:giangnh264,项目名称:mobileplus,代码行数:70,代码来源:SlController.php
示例17: KLogger
<?php
$page = "recalculatePointsForProfiles";
require '../../variables.php';
require '../../variablesdb.php';
require_once '../functions.php';
require_once './../../functions.php';
require '../../top.php';
$log = new KLogger('/var/www/yoursite/http/log/runonce/', KLogger::INFO);
echo getOuterBoxTop($leaguename . " <span class='grey-small'>»</span> Recalculate Points For Profiles", "");
?>
<?
$sql = "SELECT * FROM six_profiles where id=591 ORDER BY Id ASC";
$resultX = mysql_query($sql);
while ($profile = mysql_fetch_array($resultX)) {
$profileId = $profile['id'];
$log->logInfo('profileId='.$profileId);
$log->logInfo('RecalculatePointsForProfile='.RecalculatePointsForProfile($profile['id'], $profile['disconnects'], $profile['points'], $profile['rating']));
$log->logInfo('RecalculateStreak='.RecalculateStreak($profile['id']));
}
?>
<?php
echo getOuterBoxBottom();
?>
<?
require ('../../bottom.php');
?>
开发者ID:kinj1987,项目名称:evo-league,代码行数:31,代码来源:recalculatePointsForProfiles.php
示例18: basename
$cron_name = basename($_SERVER['PHP_SELF'], '.php');
// Include our configuration (holding defines for the requires)
require_once BASEPATH . '../include/bootstrap.php';
require_once BASEPATH . '../include/version.inc.php';
// Command line switches
array_shift($argv);
foreach ($argv as $option) {
switch ($option) {
case '-f':
$monitoring->setStatus($cron_name . "_disabled", "yesno", 0);
$monitoring->setStatus($cron_name . "_active", "yesno", 0);
break;
}
}
// Load 3rd party logging library for running crons
$log = KLogger::instance(BASEPATH . '../logs/' . $cron_name, KLogger::INFO);
$log->LogDebug('Starting ' . $cron_name);
// Load the start time for later runtime calculations for monitoring
$cron_start[$cron_name] = microtime(true);
// Check if our cron is activated
if ($monitoring->isDisabled($cron_name)) {
$log->logFatal('Cronjob is currently disabled due to errors, use -f option to force running cron.');
$monitoring->endCronjob($cron_name, 'E0018', 1, true, false);
}
// Mark cron as running for monitoring
$log->logDebug('Marking cronjob as running for monitoring');
if (!$monitoring->startCronjob($cron_name)) {
$log->logFatal('Unable to start cronjob: ' . $monitoring->getCronError());
exit;
}
// Check if we need to halt our crons due to an outstanding upgrade
开发者ID:noncepool,项目名称:php-mpos,代码行数:31,代码来源:shared.inc.php
示例19: KLogger
<?php
$page = "encrytPasswords";
require '../../variables.php';
require '../../variablesdb.php';
require_once '../functions.php';
require_once './../../functions.php';
require '../../top.php';
$log = new KLogger('/var/www/yoursite/http/log/encrypt/', KLogger::INFO);
$startId = $_GET['id'];
echo getOuterBoxTop($leaguename . " <span class='grey-small'>»</span> Encrypt Passwords", "");
?>
<?
$sql = "SELECT player_id, name FROM `weblm_players` where convert(pwd using 'utf8') like 'xxx%'";
$res = mysql_query($sql);
echo "<p>".$sql."</p>";
while ($row = mysql_fetch_array($res)) {
$id = $row['player_id'];
$name = $row['name'];
$length = 10;
$randomString = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
$pwHash = password_hash($randomString, PASSWORD_DEFAULT);
$msg = "<p>id=".$id." randomString=".$randomString." name=".$name."</p>";
$log->LogInfo($msg);
$sql = "UPDATE weblm_players set pwd='".$pwHash."' WHERE player_id=".$id;
mysql_query($sql);
开发者ID:kinj1987,项目名称:evo-league,代码行数:31,代码来源:encryptPasswords.php
示例20: __construct
public function __construct($log_directory, $debug_level)
{
$level = $debug_level != null ? $debug_level : \KLogger::DEBUG;
$this->log = \KLogger::instance($log_directory, $level);
}
开发者ID:pkdevbox,项目名称:Headstart,代码行数:5,代码来源:FileLogger.php
注:本文中的KLogger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论