Piwik\View::clearCompiledTemplates PHP Method

clearCompiledTemplates() public static method

Clear compiled Twig templates
public static clearCompiledTemplates ( )
    public static function clearCompiledTemplates()
    {
        $twig = new Twig();
        $environment = $twig->getTwigEnvironment();
        $environment->clearTemplateCache();
        $cacheDirectory = $environment->getCache();
        if (!empty($cacheDirectory) && is_dir($cacheDirectory)) {
            $environment->clearCacheFiles();
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Called on Core install, update, plugin enable/disable
  * Will clear all cache that could be affected by the change in configuration being made
  */
 public static function deleteAllCacheOnUpdate($pluginName = false)
 {
     AssetManager::getInstance()->removeMergedAssets($pluginName);
     View::clearCompiledTemplates();
     Cache::deleteTrackerCache();
     self::clearPhpCaches();
 }