當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Console::create方法代碼示例

本文整理匯總了PHP中Console::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Console::create方法的具體用法?PHP Console::create怎麽用?PHP Console::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Console的用法示例。


在下文中一共展示了Console::create方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($host, $port, $ttl)
 {
     $this->console = Console::create('cache');
     $this->ttl = $ttl;
     $this->mem = new Memcache();
     $this->mem->pconnect($host, $port);
     $this->console->log('Connecting:', $host . ':' . $port, '[ttl:' . $ttl . 's]');
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:8,代碼來源:cache.class.php

示例2: setup

 public static function setup($domain, $prefix, $host, $port, $ttl)
 {
     self::$domain = $domain;
     self::$prefix = $prefix;
     self::$console = Console::create('session');
     self::$ttl = $ttl;
     self::$mem = new Memcache();
     self::$mem->pconnect($host, $port);
     self::$console->log('Connecting:', $host . ':' . $port, '[ttl:' . $ttl . 's]');
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:10,代碼來源:session.class.php

示例3: __construct

 public function __construct($controllerPath, $cntName, $methodName, $params, $req, $res)
 {
     $this->name = $cntName;
     $this->method = $methodName;
     $this->params = $params;
     $this->reqMethod = $_SERVER['REQUEST_METHOD'];
     $this->request = $req;
     $this->response = $res;
     $this->console = Console::create('router/controllerhub');
     // start operation
     $this->init($controllerPath);
     $this->run();
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:13,代碼來源:controllerhub.class.php

示例4: __construct

 public function __construct()
 {
     $this->console = Console::create('router');
     $this->reqHook = new Hook('request');
     $this->uri = $_SERVER['REQUEST_URI'];
     // make sure to get rid of query string
     $pos = strpos($this->uri, '?');
     if ($pos !== false) {
         $this->uri = substr($this->uri, 0, $pos);
     }
     // register exception handler
     ExceptionHandler::add('respondException', $this);
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:13,代碼來源:router.class.php

示例5: __construct

 public function __construct($type, $host, $dbname, $user, $password, $dataName)
 {
     // logger
     $name = $type . '.' . $dbname . ':' . $dataName;
     $this->console = Console::create($name);
     // connect to db
     $connect = $type . ':';
     $connect .= 'host=' . $host . ';';
     $connect .= 'dbname=' . $dbname . ';';
     $connect .= 'charset=utf8';
     // use connection pooling
     $options = array(PDO::ATTR_PERSISTENT => true);
     $this->console->log('Connecting:', $type, $user . '@' . $host . '.' . $dbname, '[password:' . ($password ? 'true' : 'false') . ']');
     $this->cn = new PDO($connect, $user, $password, $options);
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:15,代碼來源:sql.class.php

示例6: __construct

 public function __construct($dataName)
 {
     $this->dataName = $dataName;
     $this->console = Console::create($this->NAME . $dataName);
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:5,代碼來源:model.class.php

示例7: __construct

 public function __construct($name)
 {
     $this->console = Console::create($name . '.hook');
 }
開發者ID:voltrue2,項目名稱:pie,代碼行數:4,代碼來源:hook.class.php


注:本文中的Console::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。