Example #1
0
 /**
  * Clear the cache. Both the doctrine FilesystemCache, as well as twig and thumbnail temp files.
  *
  * @return bool
  */
 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('/'));
         // Clear the thumbs folder.
         $this->flushDirectory($this->filesystem->getFilesystem('web')->getDir('/thumbs'));
     }
     return $result;
 }
Example #2
0
 /**
  * Clear the cache. Both the doctrine FilesystemCache, as well as twig and thumbnail temp files.
  *
  * @return array
  */
 public function doFlush()
 {
     $result = ['successfiles' => 0, 'failedfiles' => 0, 'failed' => [], 'successfolders' => 0, 'failedfolders' => 0, 'log' => ''];
     // Clear Doctrine's folder.
     parent::doFlush();
     if ($this->filesystem instanceof AggregateFilesystemInterface) {
         // Clear our own cache folder.
         $this->flushFilesystemCache($this->filesystem->getFilesystem('cache'), $result);
         // Clear the thumbs folder.
         $this->flushFilesystemCache($this->filesystem->getFilesystem('thumbs'), $result);
     }
     return $result;
 }