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


PHP Utilities::log方法代码示例

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


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

示例1: fileExists

 static function fileExists($file)
 {
     $page = self::getFilePath($file);
     if (!file_exists($page)) {
         Utilities::log("Cannot find file for render {$page}");
         return false;
     }
     return true;
 }
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:9,代码来源:render.php

示例2: load

 public function load($file)
 {
     $file = ROOT . '/lang/' . $file . '.' . self::LANG_FILE_EXT;
     if (!file_exists($file)) {
         Utilities::log("Cannot access lang file {$file}", Utilities::LOG_E);
         die;
     }
     $this->lang = parse_ini_file($file);
     if (!$this->lang) {
         Utilities::log("Cannot parse ini file {$file}", Utilities::LOG_E);
         die;
     }
 }
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:13,代码来源:lang.php

示例3: getInstance

 public static function getInstance()
 {
     if (DB::$INSTANCE == null) {
         $dsn = "mysql:host=" . Config::DB_HOST . ";dbname=" . Config::DB_NAME;
         try {
             DB::$INSTANCE = new PDO($dsn, Config::DB_USER, Config::DB_PASS, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC));
         } catch (PDOException $e) {
             $str = "Cannot connect to database " . $e->getMessage();
             Utilities::log($str, Utilities::LOG_E);
             die;
         }
     }
     return DB::$INSTANCE;
 }
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:14,代码来源:db.php

示例4: load

 public static function load()
 {
     self::$sid = self::getSid();
     $data = Db::getUserBySid(self::$sid);
     self::$id = $data['id'];
     self::$rid = $data['rid'];
     self::$ip = $data['ip'];
     self::$token = Generator::token();
     $newIp = self::getIp();
     if (self::$ip != $newIp) {
         Utilities::log("Loaded existing user, different IP " . self::toString());
         self::$ip = $newIp;
     } else {
         Utilities::log("Loaded existing user, same IP " . self::toString());
     }
     DB::updateUserById(self::$id, self::$rid, $newIp, self::$sid, self::$token);
 }
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:17,代码来源:user.php

示例5: formatRid

 public static function formatRid($rid, $format = Config::RID_DEFAULT_FORMAT)
 {
     if (substr_count($format, Config::RID_FORMAT_NUMBER) != Config::RID_LENGTH) {
         debug("Wrong count of number in format supplied for Generator::formatRid");
     }
     if (substr_count($format, Config::RID_FORMAT_NUMBER) != strlen($rid)) {
         Utilities::log("Rid.length < Format.length in Generator.formantRid({$rid}, {$format})", Utilities::LOG_W);
         return $rid;
     }
     $ridIndex = 0;
     $output = "";
     for ($i = 0; $i < strlen($format); $i++) {
         if ($format[$i] == "n") {
             $output .= $rid[$ridIndex++];
         } else {
             $output .= $format[$i];
         }
     }
     return $output;
 }
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:20,代码来源:generator.php

示例6: switch

$action = Utilities::postOrNull('action');
$token = Utilities::postOrNull('token');
$rid = Utilities::postOrNull('rid');
$page = Utilities::postOrNull('page');
User::construct($rid, $token);
if ($action == null) {
    Utilities::log("handler: Action is null " . User::toString(), Utilities::LOG_E);
    Ajax::sendError();
}
switch ($action) {
    case Config::AJAX_ACTION_GENERATE_RID:
        $data = Ajax::generateRid();
        break;
    case Config::AJAX_ACTION_GENERATE_NUMBER:
        $data = Ajax::generateNumber();
        break;
    case Config::AJAX_ACTION_CHECK_RID:
        $data = Ajax::checkRid();
        break;
    case Config::AJAX_ACTION_CHECK_USER:
        $data = Ajax::checkUser();
        break;
    case Config::AJAX_ACTION_GET_PAGE:
        $data = Ajax::getPage($page);
        break;
    default:
        Utilities::log("Incorrect action {$action} " . User::toString(), Utilities::LOG_E);
        Ajax::sendError();
}
DB::close();
exit($data);
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:31,代码来源:handler.php

示例7: actRidFormat

 public static function actRidFormat()
 {
     if (User::$rid == null) {
         Utilities::log("RID is null " . User::toString(), Utilities::LOG_E);
         self::sendError(2);
     }
     if (!Generator::checkRidFormat(User::$rid)) {
         Utilities::log("Incorrect RID format " . User::toString(), Utilities::LOG_E);
         self::sendError(0);
     }
 }
开发者ID:jDek-Mikhail,项目名称:proverid,代码行数:11,代码来源:ajax.php

示例8: log

 * F6 (Windows/Linux/Mac OS X)
 */
namespace Refactoring11\JetBrains;

// 1. Move the current file into the Code directory.
// 2. Move the Code directory and all its contents into the MoreCode directory.
// 3. Move Class1, Class2 and Class3 into separate files.
class Class1
{
}
class Class2
{
}
class Class3
{
}
// 4. Move the static method log() from the Utilities class to the Logger class.
class Utilities
{
    public static function log($message)
    {
        echo $message;
    }
}
class Logger
{
}
// 5. Note that the calls to Utilities::log() have been updated.
Utilities::log('Almost at the end of the exercise');
Utilities::log('At the end of the exercise');
开发者ID:pkdevboxy,项目名称:phpstorm-workshop,代码行数:30,代码来源:11+-+Move.php


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