本文整理匯總了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]');
}
示例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]');
}
示例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();
}
示例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);
}
示例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);
}
示例6: __construct
public function __construct($dataName)
{
$this->dataName = $dataName;
$this->console = Console::create($this->NAME . $dataName);
}
示例7: __construct
public function __construct($name)
{
$this->console = Console::create($name . '.hook');
}