Skip to content

Commit

Permalink
dispatch event before fpc save
Browse files Browse the repository at this point in the history
  • Loading branch information
GordonLesti committed Nov 20, 2014
1 parent 4015d05 commit 420df10
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/code/community/Lesti/Fpc/Model/Fpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ public function save($data, $id, $tags=array(), $lifeTime=null)
if ($lifeTime === null) {
$lifeTime = (int) $this->getFrontend()->getOption('lifetime');
}
// edit cached object
$cacheData = new Varien_Object();
$cacheData->setCachedata($data);
$cacheData->setCacheId($id);
$cacheData->setTags($tags);
$cacheData->setLifeTime($lifeTime);
Mage::dispatchEvent(
'fpc_save_data_before',
array('cache_data' => $cacheData)
);
$data = $cacheData->getCachedata();
$id = $cacheData->getCacheId();
$tags = $cacheData->getTags();
$lifeTime = $cacheData->getLifeTime();

return $this->_frontend->save(
(string)$data,
$this->_id($id),
Expand Down

0 comments on commit 420df10

Please sign in to comment.