Files
aowow/includes/libs/DbSimple/CacherImpl.php
Sarjuuk ba49c55c6b changed dbSimple version to use e1d92f1f2f
removed unused driver-implementations
2014-09-06 11:38:30 +02:00

45 lines
1.0 KiB
PHP

<?php
/**
* Created by JetBrains PhpStorm.
* User: sib
* Date: 14.10.13
* Time: 17:40
* To change this template use File | Settings | File Templates.
*/
class CacherImpl implements Zend_Cache_Backend_Interface {
protected $callback;
public function __construct($callback) {
if ( is_callable($callback) ) {
$this->callback = $callback;
} else {
$this->callback = $this->callbackDummy;
}
}
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) {}
public function remove($id) {}
public function test($id) {}
public function save($data, $id, $tags = array(), $specificLifetime = false)
{
return call_user_func($this->callback, $id, $data);
}
public function load($id, $doNotTestCacheValidity = false)
{
return call_user_func($this->callback, $id);
}
public function setDirectives($directives) {}
protected function callbackDummy($k, $v)
{
return null;
}
} // CacherImpl class