forked from ivan1986/DbSimple
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
636 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.