Cache.php in X Autoload 7.5
File
tests/src/VirtualDrupal/Cache.php
View source
<?php
namespace Drupal\xautoload\Tests\VirtualDrupal;
class Cache {
private $cache = array();
function cacheGet($cid, $bin = 'cache') {
if (!isset($this->cache[$bin][$cid])) {
return FALSE;
}
return $this->cache[$bin][$cid];
}
function cacheSet($cid, $data, $bin = 'cache') {
$this->cache[$bin][$cid] = (object) array(
'data' => $data,
);
}
function cacheClearAll($cid = NULL, $bin = NULL) {
if (!isset($cid) && !isset($bin)) {
$this
->cacheClearAll(NULL, 'cache_page');
return NULL;
}
elseif (!isset($cid)) {
unset($this->cache[$bin]);
}
elseif (!isset($bin)) {
throw new \InvalidArgumentException("No cache \$bin argument given.");
}
else {
unset($this->cache[$bin][$cid]);
}
}
}