folder = TEMP_FOLDER.'/'.$name; if (!is_dir($this->folder)) mkdir($this->folder); } function load($key) { $file = $this->folder.'/cache_'.$key; return file_exists($file) ? unserialize(file_get_contents($file)) : null; } function save($data, $key) { $file = $this->folder.'/cache_'.$key; file_put_contents($file, serialize($data)); } function clear() { array_map('unlink', glob($this->folder.'/cache_*')); } } /** * Same as ManifestCache_File, but stores the data as valid PHP which gets included to load * This is a bit faster if you have an opcode cache installed, but slower otherwise * * @package framework * @subpackage manifest */ class ManifestCache_File_PHP extends ManifestCache_File { function load($key) { global $loaded_manifest; $loaded_manifest = null; $file = $this->folder.'/cache_'.$key; if (file_exists($file)) include $file; return $loaded_manifest; } function save($data, $key) { $file = $this->folder.'/cache_'.$key; file_put_contents($file, 'pre = $name; } function load($key) { return apc_fetch($this->pre.$key); } function save($data, $key) { apc_store($this->pre.$key, $data); } function clear() { } }