Skip to content

Commit b4d6b89

Browse files
author
Jon Acker
committed
Merge pull request #8 from walterdolce/feature/fix-warning-when-attempting-file-removal
Prevent PHP Warning when attempting to delete container cache file
2 parents de84dc9 + 3e31225 commit b4d6b89

File tree

1 file changed

+4
-1
lines changed
  • app/code/community/Inviqa/SymfonyContainer/Model

1 file changed

+4
-1
lines changed

app/code/community/Inviqa/SymfonyContainer/Model/Observer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ class Inviqa_SymfonyContainer_Model_Observer
1212
public function onCacheRefresh(Varien_Event_Observer $event)
1313
{
1414
if (ConfigurationBuilder::MODEL_ALIAS === $event->getType()) {
15-
unlink(Mage::getBaseDir('cache') . '/' . ConfigurationBuilder::CACHED_CONTAINER);
15+
$filePath = Mage::getBaseDir('cache') . '/' . ConfigurationBuilder::CACHED_CONTAINER;
16+
if (file_exists($filePath)) {
17+
unlink($filePath);
18+
}
1619
}
1720
}
1821
public function onPreDispatch(Varien_Event_Observer $event)

0 commit comments

Comments
 (0)