/** * Initialise the cache driver based on config * * @param array $options array of options specific to the cache driver. * @access public * @return null */ public function init($options) { parent::init($options); $driverOptions = $this->getFilteredOption("DRIVER"); if (!is_array($driverOptions) || !isset($driverOptions['driver'])) { return; } switch ($driverOptions['driver']) { case "apc": if (!APC_EXTENSION_LOADED) { AJXP_Logger::error(__CLASS__, "init", "The APC extension package must be installed!"); return; } break; case "memcache": if (!MEMCACHE_EXTENSION_LOADED) { AJXP_Logger::error(__CLASS__, "init", "The Memcache extension package must be installed!"); return; } break; case "memcached": if (!MEMCACHED_EXTENSION_LOADED) { AJXP_Logger::error(__CLASS__, "init", "The Memcached extension package must be installed!"); return; } break; case "redis": if (!REDIS_EXTENSION_LOADED) { AJXP_Logger::error(__CLASS__, "init", "The Redis extension package must be installed!"); return; } break; case "xcache": if (!XCACHE_EXTENSION_LOADED) { AJXP_Logger::error(__CLASS__, "init", "The XCache extension package must be installed!"); return; } break; default: break; } }
/** * Save plugin registry to cache * */ public function savePluginsRegistryToCache() { if (!empty($this->cacheStorage)) { $this->cacheStorage->save(AJXP_CACHE_SERVICE_NS_SHARED, "plugins_registry", $this->registry); } }
/** * @param AJXP_Node $node * @param bool $details * @return string */ protected function computeId($node, $details) { return AbstractCacheDriver::computeIdForNode($node, "node.info", $details ? "all" : "short"); }
protected function computeCacheId($path, $type) { return AbstractCacheDriver::computeIdForNode(new AJXP_Node($path), $type); }