private function getEndpointsCache() 
    {
        if ($this->_cache === null) {
            if (!isset($this->_values[self::OPTION_MEMCACHED_SERVERS])) {
                return null;
            }
            if (!class_exists('Memcached', false)) {
                return null;
            }

            $servers = $this->_values[self::OPTION_MEMCACHED_SERVERS];
            if (!is_array($servers)) {
                throw new ClientException('Invalid memcached servers list. should be an array of servers');
            }

            $cache = new \Memcached(self::OPTION_MEMCACHED_PERSISTENT_ID);
            if (empty($cache->getServerList())) {
                $cache->addServers($servers);
            }
            
            if (isset($this->_values[self::OPTION_MEMCACHED_OPTIONS])) {
                $options = $this->_values[self::OPTION_MEMCACHED_OPTIONS];
                if (!is_array($options)) {
                    throw new ClientException('Invalid memcached options list. should be an array of options');
                }
                $cache->setOptions($options);
            }

            $this->_cache = $cache;
        
        }
        return $this->_cache;
    }
private function getEndpointsCache() 
    {
        if ($this->_cache === null) {
            if (!isset($this->_values[self::OPTION_MEMCACHED_SERVERS])) {
                return null;
            }
            if (!class_exists('Memcached', false)) {
                return null;
            }

            $servers = $this->_values[self::OPTION_MEMCACHED_SERVERS];
            if (!is_array($servers)) {
                throw new ClientException('Invalid memcached servers list. should be an array of servers');
            }

            $cache = new \Memcached(self::OPTION_MEMCACHED_PERSISTENT_ID);
            if (empty($cache->getServerList())) {
                $cache->addServers($servers);
            }
            
            if (isset($this->_values[self::OPTION_MEMCACHED_OPTIONS])) {
                $options = $this->_values[self::OPTION_MEMCACHED_OPTIONS];
                if (!is_array($options)) {
                    throw new ClientException('Invalid memcached options list. should be an array of options');
                }
                $cache->setOptions($options);
            }

            $this->_cache = $cache;
        
        }
        return $this->_cache;
    }
private function getEndpointsCache ( ) { if ( $ this -> _cache === null ) { if ( ! isset ( $ this -> _values [ self :: OPTION_MEMCACHED_SERVERS ] ) ) { return null ; } if ( ! class_exists ( 'Memcached' , false ) ) { return null ; } $ servers = $ this -> _values [ self :: OPTION_MEMCACHED_SERVERS ] ; if ( ! is_array ( $ servers ) ) { throw new ClientException ( 'Invalid memcached servers list. should be an array of servers' ) ; } $ cache = new \ Memcached ( self :: OPTION_MEMCACHED_PERSISTENT_ID ) ; if ( empty ( $ cache -> getServerList ( ) ) ) { $ cache -> addServers ( $ servers ) ; } if ( isset ( $ this -> _values [ self :: OPTION_MEMCACHED_OPTIONS ] ) ) { $ options = $ this -> _values [ self :: OPTION_MEMCACHED_OPTIONS ] ; if ( ! is_array ( $ options ) ) { throw new ClientException ( 'Invalid memcached options list. should be an array of options' ) ; } $ cache -> setOptions ( $ options ) ; } $ this -> _cache = $ cache ; } return $ this -> _cache ; }
Initialize and return a memcached cache instance,
if option "memcachedServers" is set

@return Memcached - memcached server instance if configured or null if not
Initialize and return a memcached cache instance if option memcachedServers is set