Exemplo n.º 1
0
 public static function grab($key, callable $callback, $dependencies = ['global'], $time = null)
 {
     compiler::$dependants = array_merge(compiler::$dependants, $dependencies);
     try {
         $data = cache::get($key, $dependencies);
     } catch (\Exception $e) {
         $data = $callback();
         cache::set([$key => $data], $dependencies, $time);
     }
     return $data;
 }
Exemplo n.º 2
0
 protected function save_memcached($key, $contents)
 {
     cache::set([$key => $contents], []);
 }