Файл: adultscript-2.0.3-pro/files/libraries/framework/template_cache.php
Строк: 37
<?php
defined('_VALID') or die('Restricted Access!');
class VTemplate_Cache
{
public static function cached($id, $enabled=false)
{
if (!$enabled) {
return false;
}
$file = self::get_file($id);
if (file_exists($file) && is_file($file)) {
return true;
}
return false;
}
public static function output($id)
{
$file = self::get_file($id);
require $file;
$content = ob_get_contents();
ob_end_clean();
echo VResponse::output($content);
}
public static function cache($id, $content)
{
file_put_contents(self::get_file($id), $content);
}
public static function remove($id)
{
@unlink(self::get_file($id));
}
public static function get_file($id)
{
$id = VF::cfg_item('secret').VLanguage::get('language').$id;
return CACHE_DIR.'/output/'.md5($id).'.cache.php';
}
}