Bolt\Cache::doFlush PHP Method

doFlush() protected method

Clear the cache. Both the doctrine FilesystemCache, as well as twig and thumbnail temp files.
protected doFlush ( ) : boolean
return boolean
    protected function doFlush()
    {
        // Clear Doctrine's folder.
        $result = parent::doFlush();
        if ($this->filesystem instanceof AggregateFilesystemInterface) {
            // Clear our own cache folder.
            $this->flushDirectory($this->filesystem->getFilesystem('cache')->getDir('/development'));
            $this->flushDirectory($this->filesystem->getFilesystem('cache')->getDir('/production'));
            $this->flushDirectory($this->filesystem->getFilesystem('cache')->getDir('/profiler'));
            // Clear the thumbs folder.
            $this->flushDirectory($this->filesystem->getFilesystem('web')->getDir('/thumbs'));
        }
        return $result;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Check Bolt's version against a cached key. If there is a change we flush
  * the cache data and if required synchronise asset directories.
  */
 public function checkVersion()
 {
     if ($this->checkCacheVersion()) {
         return;
     }
     $this->syncView();
     $this->cache->doFlush();
     $this->updateCacheVersion();
 }
All Usage Examples Of Bolt\Cache::doFlush