File tree 2 files changed +41
-12
lines changed
2 files changed +41
-12
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,16 @@ class Inviqa_SymfonyContainer_Model_Observer
12
12
13
13
public function onCacheRefresh (Varien_Event_Observer $ event )
14
14
{
15
- if (ConfigurationBuilder::MODEL_ALIAS === $ event ->getType ()) {
16
- $ containerFilePath = $ this ->containerCachePath ();
17
- $ metaFilePath = $ this ->containerCacheMetaPath ();
18
-
19
- if (file_exists ($ containerFilePath )) {
20
- unlink ($ containerFilePath );
21
- }
22
-
23
- if (file_exists ($ metaFilePath )) {
24
- unlink ($ metaFilePath );
25
- }
15
+ if ($ event ->getType () === ConfigurationBuilder::MODEL_ALIAS ) {
16
+ $ this ->clearCache ();
26
17
}
27
18
}
19
+
20
+ public function onCacheFlush ()
21
+ {
22
+ $ this ->clearCache ();
23
+ }
24
+
28
25
public function onPreDispatch (Varien_Event_Observer $ event )
29
26
{
30
27
$ controller = $ event ->getControllerAction ();
@@ -34,6 +31,20 @@ public function onPreDispatch(Varien_Event_Observer $event)
34
31
])->setupDependencies ($ controller );
35
32
}
36
33
34
+ private function clearCache ()
35
+ {
36
+ $ containerFilePath = $ this ->containerCachePath ();
37
+ $ metaFilePath = $ this ->containerCacheMetaPath ();
38
+
39
+ if (file_exists ($ containerFilePath )) {
40
+ unlink ($ containerFilePath );
41
+ }
42
+
43
+ if (file_exists ($ metaFilePath )) {
44
+ unlink ($ metaFilePath );
45
+ }
46
+ }
47
+
37
48
private function containerCachePath ()
38
49
{
39
50
return Mage::getBaseDir ('cache ' ) . DIRECTORY_SEPARATOR . ConfigurationBuilder::CACHED_CONTAINER ;
Original file line number Diff line number Diff line change 22
22
</inviqa_symfonyContainer >
23
23
</observers >
24
24
</adminhtml_cache_refresh_type >
25
+ <adminhtml_cache_flush_all >
26
+ <observers >
27
+ <inviqa_symfonyContainer >
28
+ <class >Inviqa_SymfonyContainer_Model_Observer</class >
29
+ <type >singleton</type >
30
+ <method >onCacheFlush</method >
31
+ </inviqa_symfonyContainer >
32
+ </observers >
33
+ </adminhtml_cache_flush_all >
34
+ <adminhtml_cache_flush_system >
35
+ <observers >
36
+ <inviqa_symfonyContainer >
37
+ <class >Inviqa_SymfonyContainer_Model_Observer</class >
38
+ <type >singleton</type >
39
+ <method >onCacheFlush</method >
40
+ </inviqa_symfonyContainer >
41
+ </observers >
42
+ </adminhtml_cache_flush_system >
25
43
<controller_action_predispatch >
26
44
<observers >
27
45
<inviqa_symfonyContainer >
43
61
</cache >
44
62
</global >
45
63
46
- </config >
64
+ </config >
You can’t perform that action at this time.
0 commit comments