/** * Initialises the cache. * * Once this has been done the cache is all set to be used. * * @param cache_definition $definition */ public function initialise(cache_definition $definition) { $this->storeid = $definition->generate_definition_hash(); $this->store =& self::register_store_id($this->name . '-' . $definition->get_id()); $this->ttl = $definition->get_ttl(); $maxsize = $definition->get_maxsize(); if ($maxsize !== null) { // Must be a positive int. $this->maxsize = abs((int) $maxsize); $this->storecount = count($this->store); } $this->check_ttl(); }
/** * Initialises the cache. * * Once this has been done the cache is all set to be used. * * @param cache_definition $definition */ public function initialise(cache_definition $definition) { $keyarray = $definition->generate_multi_key_parts(); $this->storeid = $keyarray['mode'] . '/' . $keyarray['component'] . '/' . $keyarray['area'] . '/' . $keyarray['siteidentifier']; $this->store =& self::register_store_id($this->storeid); $maxsize = $definition->get_maxsize(); $this->simpledata = $definition->uses_simple_data(); if ($maxsize !== null) { // Must be a positive int. $this->maxsize = abs((int) $maxsize); $this->storecount = count($this->store); } }