Пример #1
0
 public static function getConnection()
 {
     if (empty(self::$connection)) {
         $config = ZConfig::get('connection');
         self::$connection = CFactory::getInstance($config['adapter'], $config);
     }
     return self::$connection;
 }
Пример #2
0
 private function getConnection()
 {
     if (empty($this->connection)) {
         $config = ZConfig::get('connection');
         $this->connection = CFactory::getInstance($config['adapter'], $config);
     }
     return $this->connection;
 }
Пример #3
0
 public function getConnection()
 {
     if (empty($this->conn)) {
         $this->conn = ZConn::getInstance();
     }
 }
Пример #4
0
 public static function online($channel = 'ALL')
 {
     $config = ZConfig::get('connection');
     $connection = ZConn::getInstance($config['adapter'], $config);
     return $connection->getChannel($channel);
 }
Пример #5
0
 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);
     }
 }
Пример #6
0
 private function getConn()
 {
     return ZConn::getInstance('Redis', ZConfig::get('connection'));
 }
Пример #7
0
 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];
 }