/** * Clears all parsed template files in the cache folder. * * Can only be called once per request (there may be multiple SSViewer instances). * * @param bool $force Set this to true to force a re-flush. If left to false, flushing * may only be performed once a request. */ public static function flush_template_cache($force = false) { if (!self::$template_cache_flushed || $force) { $dir = dir(TEMP_FOLDER); while (false !== ($file = $dir->read())) { if (strstr($file, '.cache')) { unlink(TEMP_FOLDER . '/' . $file); } } self::$template_cache_flushed = true; } }