ACC SHELL
<?php
// Author: Jakub Macek, CZ; Copyright: Poski.com s.r.o.; Code is 100% my work. Do not copy.
class Cache
{
public static $templates = array();
public static $container = array();
public static function get()
{
$args = func_get_args();
$id = implode(chr(254), $args);
return (isset(self::$container[$id]) ? self::$container[$id] : null);
}
public static function set()
{
$args = func_get_args();
$value = array_shift($args);
$id = implode(chr(254), $args);
self::$container[$id] = $value;
}
public static function pget()
{
$args = func_get_args();
$id = implode('$', $args);
$file = DATA . 'cache/[cache]' . $id;
return (is_file($file) ? unserialize(file_get_contents($file)) : null);
}
public static function pset()
{
$args = func_get_args();
$value = array_shift($args);
$id = implode('$', $args);
$file = DATA . 'cache/[cache]' . $id;
file_put_contents($file, serialize($value));
}
public static function tset($file, $ttl, $id = '')
{
self::$templates[$file] = array(
'file' => $file,
'ttl' => $ttl,
'id' => $id,
);
}
public static function tget($file)
{
return (isset(self::$templates[$file]) ? self::$templates[$file] : null );
}
}
?>
ACC SHELL 2018