/** * Constructor. * * @param array $options Optional; the options of cache adapter */ public function __construct(array $options = []) { $enabled = $this->enabled; if (array_key_exists('enabled', $options)) { $enabled = $options['enabled']; unset($options['enabled']); } parent::__construct($options); static::$namespaces[$this->namespace] = $this; $this->setEnabled($enabled); }
/** * Sets the cache. * * @param \Es\Cache\AbstractCache $cache The cache adapter */ public function setCache(AbstractCache $cache) { $this->cache = $cache->withNamespace('system'); }