Skip to content

Commit 3e31225

Browse files
committed
Prevent PHP Warning when attempting to delete container cache file
1 parent de84dc9 commit 3e31225

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)