当前位置: 首页>>代码示例>>PHP>>正文


PHP CLog类代码示例

本文整理汇总了PHP中CLog的典型用法代码示例。如果您正苦于以下问题:PHP CLog类的具体用法?PHP CLog怎么用?PHP CLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($class, $msg = NULL)
 {
     if ($msg != NULL) {
         $this->message = $msg . " в файле " . $this->file . " в строке #" . $this->line;
     }
     if (CApp::settings("APPLICATION")->settings['logs_on']) {
         $log = new CLog();
         $log->logging($class, $this->message);
     }
 }
开发者ID:ennjamusic,项目名称:study,代码行数:10,代码来源:CException.php

示例2: __construct

 public function __construct($class, $msg = NULL)
 {
     if ($msg != NULL) {
         $this->message = $msg . " в файле " . $this->file;
     }
     if (LOGS_ON) {
         $log = new CLog();
         $log->logging($class, $this->message);
     }
 }
开发者ID:ennjamusic,项目名称:study,代码行数:10,代码来源:CException.php

示例3: smarty_modifier_domain

/**
 *
 *
 * @file modifier.domain.php
 * @package plugins
 * @author liyudong@baidu.com
 * @date 2011-11-03 10:47
 */
function smarty_modifier_domain($string, $encodeURI = false)
{
    $logArr['smarty_modifier'] = "modifier_domain";
    $status = 0;
    $logArr['url'] = $string;
    $domain = $string;
    if (strncasecmp($domain, "http://", 7) == 0) {
        $domain = substr($domain, 7);
    } elseif (strncasecmp($domain, "url:", 4) == 0) {
        $pos = strspn($domain, " ", 4);
        $domain = substr($domain, 4 + $pos);
        if (strncasecmp($domain, "http://", 7) == 0) {
            $domain = substr($domain, 7);
        }
    }
    if (strlen($domain) == 0) {
        $domain = $string;
    }
    if ($encodeURI) {
        $result = hilight_encodeURI($domain);
        $logArr['result'] = $result;
        if (false === $result) {
            $status = -1;
            CLog::warning("fail to call hilight_domain", $status, $logArr, 1);
            return $domain;
        }
    } else {
        $result = $domain;
    }
    return $result;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:39,代码来源:modifier.domain.php

示例4: __construct

 /**
  * @param Account $oAccount
  * @return CSieveStorage
  */
 public function __construct(Account $oAccount)
 {
     $this->_oLog =& CLog::CreateInstance();
     $this->_sLogin = $oAccount->MailIncLogin;
     $this->_sPassword = $oAccount->MailIncPassword;
     $this->_oSieve = null;
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:11,代码来源:class_sieve.php

示例5: smarty_modifier_url_bold_html

/**
 *
 *
 * @file modifier.url_bold_html.php
 * @package plugins
 * @author liyudong@baidu.com
 * @date 2011-11-03 10:40
 */
function smarty_modifier_url_bold_html($string)
{
    $logArr['smarty_modifier'] = "modifier_url_bold_html";
    $status = 0;
    $logArr['string'] = $string;
    if (strlen($string) == 0) {
        $result = $string;
        return $result;
    }
    $prefix = $GLOBALS['DISPLAY']['BOLD_PREFIX'];
    $suffix = $GLOBALS['DISPLAY']['BOLD_SUFFIX'];
    $logArr['prefix'] = $prefix;
    $logArr['suffix'] = $suffix;
    $result = hilight_url_bold_html($string, $prefix, $suffix);
    if (false === $result) {
        $result = $string;
        $status = -1;
        $logArr['result'] = $result;
        CLog::warning("fail to call hilight_url_bold_html", $status, $logArr, 1);
        return $result;
    }
    $logArr['result'] = $result;
    CLog::debug("success to call url_bold_html modifier", $status, $logArr, 1);
    return $result;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:33,代码来源:modifier.url_bold_html.php

示例6: smarty_modifier_url_limit

/**
 *
 *
 * @file modifier.url_limit.php
 * @package plugins
 * @author liyudong@baidu.com
 * @date 2011-11-03 10:40
 */
function smarty_modifier_url_limit($string, $length, $escaped = false)
{
    $logArr['smarty_modifier'] = "modifier_url_limit";
    $status = 0;
    $logArr['url'] = $string;
    $logArr['limit_len'] = $length;
    $logArr['escaped'] = $escaped;
    if (strlen($string) == 0) {
        $result = $string;
        return $result;
    }
    $result = trim(hilight_url_limit($string, $length, $escaped));
    $resultTmp = explode(" ", $result);
    $result = implode("", $resultTmp);
    if (false === $result) {
        $result = $string;
        $status = -1;
        $logArr['result'] = $result;
        CLog::warning("fail to call hilight_url_limit", $status, $logArr, 1);
        return $string;
    }
    $logArr['result'] = $result;
    CLog::debug("success to call url_limit", $status, $logArr, 1);
    return $result;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:33,代码来源:modifier.url_limit.php

示例7: smarty_modifier_strlen_character

/**
 *
 *
 * @file modifier.strlen_character.php
 * @package plugins
 * @purpose: Calculate the number of characters of a string
 * @author chenchen20@baidu.com
 * @date 2014-03-07 14:02
 */
function smarty_modifier_strlen_character($string)
{
    $logArr['smarty_modifier'] = "modifier_strlen_character";
    $status = 0;
    $intI = 0;
    $intCount = 0;
    $logArr['string'] = $string;
    $intLength = strlen($string);
    if ($intLength == 0) {
        $status = -1;
        CLog::warning("string is empty", $status, $logArr, 1);
        return 0;
    }
    while ($intI < $intLength) {
        $chrAscii = ord($string[$intI]);
        //按字节转成ascii码
        $intCount++;
        $intI++;
        if ($intI >= $intLength) {
            break;
        }
        if ($chrAscii & 0x80) {
            //汉字的两个字符ascii码都大于0x80,此处判断是否为汉字
            $chrAscii <<= 1;
            while ($chrAscii & 0x80) {
                //判断为汉字,$intCount自增1.
                $intI++;
                $chrAscii <<= 1;
            }
        }
    }
    return $intCount;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:42,代码来源:modifier.strlen_character.php

示例8: smarty_function_widget

/**
 *
 *
 * @file function.widget.php
 * @package plugins
 * @author liyudong@baidu.com
 * @date 2011-11-03 10:47
 */
function smarty_function_widget($params, Smarty_Internal_Template $template)
{
    $logArr['smarty_function'] = "function_widget";
    $name = $params['name'];
    $tpl_path = $params['path'];
    $fn = 'smarty_template_function_' . $name;
    $type = $template->smarty->getTemplateVars('_TEMPLATE_TYPE');
    $logArr['widget_name'] = $name;
    $logArr['widget_type'] = $type;
    $logArr['widget_path'] = $tpl_path;
    if (!function_exists($fn)) {
        //$tpl_path = CSmarty::getWidgetPath($type, $name);
        if (!$template->smarty->templateExists($tpl_path)) {
            $log_str = "widget not found :{$tpl_path}";
            CSmarty::addError($log_str);
            CLog::warning($log_str, -1, $logArr, 1);
            return false;
        }
        $template->smarty->fetch($tpl_path);
    }
    if (!function_exists($fn)) {
        $log_str = "template function {$fn} not found";
        CSmarty::addError($log_str);
        CLog::warning($log_str, -1, $logArr, 1);
        return false;
    } else {
        $result = $fn($template, $params);
    }
    return $result;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:38,代码来源:function.widget.php

示例9: smarty_modifier_format_int

/**
 *
 *
 * @file modifier.format_int.php
 * @package plugins
 * @author liyudong@baidu.com
 * @date 2011-11-03 10:47
 */
function smarty_modifier_format_int($number)
{
    $logArr['smarty_modifier'] = "modifier_format_int";
    $status = 0;
    $number = sprintf("%F", $number);
    $logArr['number'] = $number;
    $size = strlen($number);
    for ($i = $size - 1, $j = 1; $i >= 0; $i--, $j++) {
        $word = substr($number, $i, 1);
        if ($word === ".") {
            $result = "";
            $j = 0;
            continue;
        }
        if ($i < 3) {
            $result = $word . $result;
        } else {
            $result = "0" . $result;
        }
        if ($j % 3 == 0 && $i != 0) {
            $result = "," . $result;
        }
    }
    $logArr['result'] = $result;
    CLog::debug("success to call format_int", $status, $logArr, 1);
    return $result;
}
开发者ID:drehere,项目名称:shenmegui,代码行数:35,代码来源:modifier.format_int.php

示例10: DbOdbc

 /**
  * @param string $customConnectionString
  * @return DbOdbc
  */
 function DbOdbc($customConnectionString, $dbType, $user = '', $pass = '')
 {
     $this->_dbCustomConnectionString = $customConnectionString;
     $this->_dbType = $dbType;
     $this->_user = $user;
     $this->_pass = $pass;
     $this->_log =& CLog::CreateInstance();
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:12,代码来源:odbc.php

示例11: DbMySql

 /**
  * @param string $host
  * @param string $user
  * @param string $password
  * @param string $dbName
  * @return DbMySql
  */
 function DbMySql($host, $user, $password, $dbName)
 {
     $this->_host = $host;
     $this->_user = $user;
     $this->_password = $password;
     $this->_dbName = $dbName;
     $this->_log =& CLog::CreateInstance();
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:15,代码来源:mysql.php

示例12: __construct

 public function __construct()
 {
     $this->account = null;
     $this->userId = null;
     $this->responseStatus = X_WMP_RESPONSE_STATUS_OK;
     $this->response = '';
     $this->log = null;
     $this->log =& CLog::CreateInstance();
 }
开发者ID:JDevelopers,项目名称:Mail,代码行数:9,代码来源:class_sync_base.php

示例13: WMserverStorage

 /**
  * @access public
  * @param Account $account
  * @return XmailStorage
  */
 function WMserverStorage(&$account)
 {
     MailServerStorage::MailServerStorage($account);
     $email = $account->Email;
     $basePath = $this->_settings->WmServerRootPath;
     $this->_wmserver = new WMserverFS($basePath, $email);
     $this->_wmadmin = new CWmServerConsole();
     $this->_log =& CLog::CreateInstance();
 }
开发者ID:diedsmiling,项目名称:busenika,代码行数:14,代码来源:class_wmserverstorage.php

示例14: mux

 public function mux($logged)
 {
     $session = new USession();
     $VIndex = new VIndex();
     switch ($VIndex->getController()) {
         case 'log':
             $CLog = new CLog();
             $log = $CLog->mux();
             if ($VIndex->getTask() == 'in' || $VIndex->getTask() == 'out') {
                 $VIndex->deleteController();
                 $VIndex->deleteTask();
                 return $this->setPage();
             } else {
                 return $log;
             }
         case 'rent':
             if ($logged >= 0) {
                 $CRent = new CRent();
                 return $CRent->mux();
             } else {
                 return $VIndex->fetch('forbidden_user.tpl');
             }
         case 'user':
             if ($logged >= 0) {
                 $CUser = new CUser();
                 return $CUser->mux();
             } else {
                 return $VIndex->fetch('forbidden_user.tpl');
             }
         case 'admin':
             if ($logged >= 1) {
                 $CAdmin = new CAdmin();
                 return $CAdmin->mux();
             } else {
                 return $VIndex->fetch('forbidden_admin.tpl');
             }
         case 'static':
             $CStatic = new CStatic();
             return $CStatic->mux($logged);
         default:
             $CStatic = new CStatic();
             return $CStatic->mux($logged);
     }
 }
开发者ID:AngeloDamiani,项目名称:MyBeach,代码行数:44,代码来源:CIndex.class.php

示例15: setItem

 public function setItem($key, $val, $expiration = 0)
 {
     //$val = implode(' ',$val);
     $val = serialize($val);
     $rc = $this->_cacheBase->set($key, $val, $expiration);
     if (false === $rc) {
         CLog::warning("ImgPredict setItem failed," . $this->_cacheBase->getErrMsg());
     }
     return $rc;
 }
开发者ID:drehere,项目名称:shenmegui,代码行数:10,代码来源:ImagePredict.php


注:本文中的CLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。