/** * CacheReader constructor. */ public function __construct(Pool $pool) { if ($pool->getDriver() instanceof Ephemeral) { throw new InvalidCacheDriverException("Ephemeral cannot be used as a cache driver in this app"); } $this->pool = $pool; }
/** * Disables the cache */ public function disable() { // save the current driver if not yet black hole so it can be restored on enable() if (!$this->pool->getDriver() instanceof BlackHole) { $this->driver = $this->pool->getDriver(); } $this->pool->setDriver(new BlackHole()); $this->enabled = false; }