lib/Factory.php
public function factory()
    {
        $redis = new \Redis();
        $host = $this->getConfig()->getValue(self::CONFIG_HOST);
        $port = $this->getConfig()->getValue(self::CONFIG_PORT);
        $timeout = $this->getConfig()->getValue(self::CONFIG_TIMEOUT);

        if ($this->getConfig()->getValueFlag(self::CONFIG_PERSISTENT)) {
            $redis->pconnect($host, $port, $timeout);
        } else {
            $redis->connect($host, $port, $timeout);
        }

        if ($this->getConfig()->hasValue(self::CONFIG_DATABASE)) {
            $redis->select($this->getConfig()->getValue(self::CONFIG_DATABASE));
        }

        return $redis;
    }
public function factory()
    {
        $redis = new \Redis();
        $host = $this->getConfig()->getValue(self::CONFIG_HOST);
        $port = $this->getConfig()->getValue(self::CONFIG_PORT);
        $timeout = $this->getConfig()->getValue(self::CONFIG_TIMEOUT);

        if ($this->getConfig()->getValueFlag(self::CONFIG_PERSISTENT)) {
            $redis->pconnect($host, $port, $timeout);
        } else {
            $redis->connect($host, $port, $timeout);
        }

        if ($this->getConfig()->hasValue(self::CONFIG_DATABASE)) {
            $redis->select($this->getConfig()->getValue(self::CONFIG_DATABASE));
        }

        return $redis;
    }
public function factory ( ) { $ redis = new \ Redis ( ) ; $ host = $ this -> getConfig ( ) -> getValue ( self :: CONFIG_HOST ) ; $ port = $ this -> getConfig ( ) -> getValue ( self :: CONFIG_PORT ) ; $ timeout = $ this -> getConfig ( ) -> getValue ( self :: CONFIG_TIMEOUT ) ; if ( $ this -> getConfig ( ) -> getValueFlag ( self :: CONFIG_PERSISTENT ) ) { $ redis -> pconnect ( $ host , $ port , $ timeout ) ; } else { $ redis -> connect ( $ host , $ port , $ timeout ) ; } if ( $ this -> getConfig ( ) -> hasValue ( self :: CONFIG_DATABASE ) ) { $ redis -> select ( $ this -> getConfig ( ) -> getValue ( self :: CONFIG_DATABASE ) ) ; } return $ redis ; }
Creates a configured \Redis instance in the object context

@param ConfigInterface $config
@return \Redis
Creates a configured \ Redis instance in the object context