public static function getConnection() { if (empty(self::$connection)) { $config = ZConfig::get('connection'); self::$connection = CFactory::getInstance($config['adapter'], $config); } return self::$connection; }
private function getConnection() { if (empty($this->connection)) { $config = ZConfig::get('connection'); $this->connection = CFactory::getInstance($config['adapter'], $config); } return $this->connection; }
public function getConnection() { if (empty($this->conn)) { $this->conn = ZConn::getInstance(); } }
public static function online($channel = 'ALL') { $config = ZConfig::get('connection'); $connection = ZConn::getInstance($config['adapter'], $config); return $connection->getChannel($channel); }
public function onWorkerStart() { $params = func_get_args(); //$worker_id = $params[1]; //echo "WorkerStart[$worker_id]|pid=" . posix_getpid() . ".\n"; $config = ZConfig::getField('cache', 'locale'); $this->cache = ZCache::getInstance($config['adapter'], $config); $this->serv = $params[0]; if (is_file(__DIR__ . DS . 'Mimes.php')) { $mimes = (include __DIR__ . DS . 'Mimes.php'); $this->mimes = array_flip($mimes); } }
private function getConn() { return ZConn::getInstance('Redis', ZConfig::get('connection')); }
public function onWorkerStart() { $params = func_get_args(); //$worker_id = $params[1]; //echo "WorkerStart[$worker_id]|pid=" . posix_getpid() . ".\n"; $config = ZConfig::getField('cache', 'locale'); $this->cache = ZConn::getInstance($config['adapter'], $config); $this->serv = $params[0]; }