SimplePie_Cache_Memcached::__construct() public WP 1.0
Create a new cache object
{} Это метод класса: SimplePie_Cache_Memcached{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$SimplePie_Cache_Memcached = new SimplePie_Cache_Memcached(); $SimplePie_Cache_Memcached->__construct( $location, $name, $type );
- $location(строка) (обязательный)
- Location string (from SimplePie::$cache_location)
- $name(строка) (обязательный)
- Unique ID for the cache
- $type(строка) (обязательный)
- Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data
Код SimplePie_Cache_Memcached::__construct() SimplePie Cache Memcached:: construct WP 5.7.1
public function __construct($location, $name, $type) {
$this->options = array(
'host' => '127.0.0.1',
'port' => 11211,
'extras' => array(
'timeout' => 3600, // one hour
'prefix' => 'simplepie_',
),
);
$this->options = SimplePie_Misc::array_merge_recursive($this->options, SimplePie_Cache::parse_URL($location));
$this->name = $this->options['extras']['prefix'] . md5("$name:$type");
$this->cache = new Memcached();
$this->cache->addServer($this->options['host'], (int)$this->options['port']);
}