31 private static function deprecated($message =
'Obsolete cache call.')
34 $stack = debug_backtrace();
35 $frameSelf = $stack[1];
36 $frame = isset($stack[2]) ? $stack[2] :
false;
37 $append =
' ' . get_called_class() .
'::' . $frameSelf[
'function'] .
'() called from ';
38 if ($frame !==
false) {
39 $append .= $frame[
'function'] .
'() in ';
41 $append .= $frameSelf[
'file'] .
' line '. $frameSelf[
'line'];
52 return \Xoops::getInstance()->cache();
60 public static function gc()
63 $cache = self::getCache();
64 return $cache->garbageCollect();
76 public static function write($key, $value, $duration = 0)
79 $ttl = intval($duration);
80 $ttl = $ttl > 0 ? $ttl : null;
81 $cache = self::getCache();
82 return $cache->write($key, $value, $ttl);
94 public static function read($key)
97 $cache = self::getCache();
98 return $cache->read($key);
108 public static function delete($key)
111 $cache = self::getCache();
112 return $cache->delete($key);
123 $cache = self::getCache();
124 return $cache->clear();
137 self::deprecated(sprintf(
'XoopsCache->%s() is no longer used',
$name));
151 self::deprecated(sprintf(
'XoopsCache::%s() is no longer used',
$name));
static __callStatic($name, $args)
static write($key, $value, $duration=0)
static deprecated($message= 'Obsolete cache call.')