本文整理汇总了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');
}