WordPress at Your Fingertips
function is not described

SimplePie_Cache_Memcached::__construct() public WP 1.0

Create a new cache object

{} It's a method of the class: SimplePie_Cache_Memcached{}

No Hooks.


null. Nothing.


$SimplePie_Cache_Memcached = new SimplePie_Cache_Memcached();
$SimplePie_Cache_Memcached->__construct( $location, $name, $type );
$location(string) (required)
Location string (from SimplePie::$cache_location)
$name(string) (required)
Unique ID for the cache
$type(string) (required)
Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data

Code of SimplePie_Cache_Memcached::__construct() WP 5.8.3

public function __construct($location, $name, $type) {
    $this->options = array(
        'host'   => '',
        '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']);