-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: app/Config/version.php app/Model/Entry.php
- Loading branch information
Showing
170 changed files
with
4,451 additions
and
2,973 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<?php | ||
Configure::write('Saito.v', '2013-07.01b'); | ||
Configure::write('Saito.v', '2013-08.01'); |
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 |
---|---|---|
@@ -1,66 +1,37 @@ | ||
<?php | ||
|
||
App::uses('Component', 'Controller'); | ||
App::import('Lib', 'CacheSupport'); | ||
App::uses('CacheTree', 'Lib/CacheTree'); | ||
|
||
class CacheSupportComponent extends Component { | ||
|
||
public $components = [ | ||
'CacheTree' | ||
]; | ||
protected $_CacheSupport; | ||
|
||
public $CacheTree; | ||
|
||
public function initialize(Controller $Controller) { | ||
$this->_CacheSupport = new CacheSupport(); | ||
$this->CacheTree = CacheTree::getInstance(); | ||
$this->CacheTree->initialize($Controller); | ||
} | ||
|
||
public function beforeRedirect(Controller $Controller, $url, $status = null, $exit = true) { | ||
$this->CacheTree->beforeRedirect($Controller, $url, $status, $exit); | ||
} | ||
|
||
public function shutdown(Controller $Controller) { | ||
$this->CacheTree->shutdown($Controller); | ||
} | ||
|
||
public function clearAll() { | ||
$this->clearSaito(); | ||
$this->clearApc(); | ||
$this->clearCake(); | ||
} | ||
|
||
public function clearSaito() { | ||
Cache::clear(false, 'default'); | ||
Cache::clear(false, 'short'); | ||
$this->clearTrees(); | ||
} | ||
|
||
public function clearCake() { | ||
Cache::clearGroup('persistent'); | ||
Cache::clearGroup('models'); | ||
Cache::clearGroup('views'); | ||
} | ||
|
||
public function clearTree($id) { | ||
$this->_clearEntries(); | ||
$this->CacheTree->delete($id); | ||
public function beforeRender(Controller $Controller) { | ||
$Controller->set('CacheTree', $this->CacheTree); | ||
} | ||
|
||
public function clearTrees() { | ||
$this->_clearEntries(); | ||
$this->CacheTree->reset(); | ||
public function beforeRedirect(Controller $Controller, $url, $status = null, $exit = true) { | ||
$this->CacheTree->saveCache(); | ||
} | ||
|
||
protected function _clearEntries() { | ||
Cache::clear(false, 'entries'); | ||
public function shutdown(Controller $Controller) { | ||
$this->CacheTree->saveCache(); | ||
} | ||
|
||
/** | ||
* Clears out the APC if available | ||
*/ | ||
public function clearApc() { | ||
if (function_exists('apc_store')) { | ||
apc_clear_cache(); | ||
apc_clear_cache('user'); | ||
apc_clear_cache('opcode'); | ||
public function __call($method, $params) { | ||
$proxy = [$this->_CacheSupport, $method]; | ||
if (is_callable($proxy)) { | ||
return call_user_func_array($proxy, $params); | ||
} | ||
} | ||
|
||
} |
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.