Contao\CoreBundle\Cache\ContaoCacheClearer::clear PHP Method

clear() public method

public clear ( $cacheDir )
    public function clear($cacheDir)
    {
        $this->filesystem->remove($cacheDir . '/contao/config');
        $this->filesystem->remove($cacheDir . '/contao/dca');
        $this->filesystem->remove($cacheDir . '/contao/languages');
        $this->filesystem->remove($cacheDir . '/contao/sql');
    }

Usage Example

 /**
  * Tests the clear() method.
  */
 public function testClear()
 {
     $fs = new Filesystem();
     $cacheDir = $this->getCacheDir();
     $fs->mkdir("{$cacheDir}/contao/config");
     $this->assertFileExists("{$cacheDir}/contao/config");
     $clearer = new ContaoCacheClearer($fs);
     $clearer->clear($cacheDir);
     $this->assertFileNotExists("{$cacheDir}/contao/config");
 }
All Usage Examples Of Contao\CoreBundle\Cache\ContaoCacheClearer::clear
ContaoCacheClearer