Ejemplo n.º 1
0
 function __construct($config = array(), $poolSize = 100)
 {
     if (empty($config['host'])) {
         throw new Swoole\Exception\InvalidParam("require redis host option.");
     }
     if (empty($config['port'])) {
         $config = self::DEFAULT_PORT;
     }
     parent::__construct($config, $poolSize);
     $this->create(array($this, 'connect'));
 }
Ejemplo n.º 2
0
 function __construct($config, $maxConnection = 100)
 {
     if (empty($config['host'])) {
         throw new Swoole\Exception\InvalidParam("require mysql host option.");
     }
     if (empty($config['port'])) {
         $config['port'] = self::DEFAULT_PORT;
     }
     parent::__construct($config, $maxConnection);
     $this->create(array($this, 'connect'));
 }