clearCache() public method

We just need to clear the template caches and the cabin data.
public clearCache ( ) : boolean
return boolean
Ejemplo n.º 1
0
 /**
  * Clear the cache files related to Cabins.
  *
  * @return bool
  */
 public function clearCache() : bool
 {
     $name = $this->makeNamespace($this->supplier->getName(), $this->package);
     $toDelete = [\implode(DIRECTORY_SEPARATOR, [ROOT, 'tmp', 'cache', 'cargo-' . $name . '.cache.json']), \implode(DIRECTORY_SEPARATOR, [ROOT, 'tmp', 'cache', 'csp.' . $name . '.json']), \implode(DIRECTORY_SEPARATOR, [ROOT, 'tmp', 'cache', $name . '.motifs.json'])];
     foreach ($toDelete as $file) {
         if (\file_exists($file)) {
             \unlink($file);
         }
     }
     return parent::clearCache();
 }