<?php require_once '../../src/Nix/loader.php'; use Nix\Caching\Cache, Nix\Debugging\Debugger; Debugger::init(true); Debugger::setLogPath(__DIR__ . '/../temp/'); $cache = new Cache(); $cache->clean(array('priority' => 5, 'tags' => 'tag-test'));
<?php require_once '../../src/Nix/loader.php'; use Nix\Caching\Cache, Nix\Debugging\Debugger; Debugger::init(true); Debugger::setLogPath(__DIR__ . '/../temp/'); $cache = new Cache(); //$cache->delete('var'); if (isset($cache['var'])) { echo "Cached: " . $cache['var']; } else { $var = date('H:i.s'); echo "saving. " . $var; $cache->set('var', $var, array('files' => array(__FILE__), 'tags' => 'tag-test', 'priority' => 6)); }
<?php require_once '../../src/Nix/loader.php'; use Nix\Caching\Cache, Nix\Debugging\Debugger; Debugger::setLogPath(__DIR__ . '/../temp/'); Debugger::init(true); $cache = new Cache(); if ($cache->isCached('var')) { echo "cached: " . $cache['var']; } else { $cache->set('var', 'variable', array('expires' => 60, 'sliding' => true)); echo "saved"; }