Buric_Apc - Version 1.0.0.0

Version Notes

Initial

Download this release

Release Info

Developer Zvonimir Burić
Extension Buric_Apc
Version 1.0.0.0
Comparing to
See all releases


Version 1.0.0.0

app/code/community/Buric/Apc/Model/Observer.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The "observer" model.
5
+ *
6
+ * @author Zvonimir Buric <zvonimir.buric@gmail.com>
7
+ * @link https://github.com/buric/Inchoo_Apc
8
+ */
9
+
10
+ class Buric_Apc_Model_Observer {
11
+
12
+ public function clearApc() {
13
+ return apc_clear_cache() && apc_clear_cache('user') && apc_clear_cache('opcode');
14
+ }
15
+ }
app/code/community/Buric/Apc/controllers/Adminhtml/ClearapcController.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * The "clear" controller.
5
+ *
6
+ * @author Zvonimir Buric <zvonimir.buric@gmail.com>
7
+ * @link https://github.com/buric/Inchoo_Apc
8
+ */
9
+
10
+ class Buric_Apc_Adminhtml_ClearapcController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+ public function indexAction()
13
+ {
14
+ if(function_exists('apc_clear_cache'))
15
+ {
16
+ if(
17
+ Mage::getModel('buric_apc/observer')->clearApc()
18
+ )
19
+ {
20
+ Mage::getSingleton('adminhtml/session')->addSuccess('APC cache flushed successfully.');
21
+ }
22
+ else
23
+ {
24
+ Mage::getSingleton('adminhtml/session')->addError('Something went wrong while flushing APC cache.');
25
+ }
26
+ $this->_redirect('adminhtml/cache/index');
27
+ }
28
+ else
29
+ {
30
+ Mage::getSingleton('adminhtml/session')->addNotice('APC is not installed.');
31
+ $this->_redirect('adminhtml/cache/index');
32
+ }
33
+ }
34
+ }
app/code/community/Buric/Apc/etc/config.xml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Buric_Apc>
5
+ <version>1.0.0</version>
6
+ </Buric_Apc>
7
+ </modules>
8
+ <admin>
9
+ <routers>
10
+ <adminhtml>
11
+ <args>
12
+ <modules>
13
+ <Buric_Apc before="Mage_Adminhtml">Buric_Apc_Adminhtml</Buric_Apc>
14
+ </modules>
15
+ </args>
16
+ </adminhtml>
17
+ </routers>
18
+ </admin>
19
+ <global>
20
+ <models>
21
+ <buric_apc>
22
+ <class>Buric_Apc_Model</class>
23
+ </buric_apc>
24
+ </models>
25
+ </global>
26
+ <adminhtml>
27
+ <events>
28
+ <controller_action_postdispatch_adminhtml_cache_flushAll>
29
+ <observers>
30
+ <buric_apc>
31
+ <type>singleton</type>
32
+ <class>buric_apc/observer</class>
33
+ <method>clearApc</method>
34
+ </buric_apc>
35
+ </observers>
36
+ </controller_action_postdispatch_adminhtml_cache_flushAll>
37
+ <controller_action_postdispatch_adminhtml_cache_flushSystem>
38
+ <observers>
39
+ <buric_apc>
40
+ <type>singleton</type>
41
+ <class>buric_apc/observer</class>
42
+ <method>clearApc</method>
43
+ </buric_apc>
44
+ </observers>
45
+ </controller_action_postdispatch_adminhtml_cache_flushSystem>
46
+ </events>
47
+ </adminhtml>
48
+ </config>
app/design/adminhtml/default/default/template/system/cache/additional.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <br/>
2
+ <div class="content-header">
3
+ <table cellspacing="0">
4
+ <tr>
5
+ <td><h3><?php echo Mage::helper('adminhtml')->__('Additional Cache Management') ?></h3></td><td class="form-buttons"></td>
6
+ </tr>
7
+ </table>
8
+ </div>
9
+ <table class="form-list">
10
+ <tr>
11
+ <td class="scope-label">
12
+ <button onclick="setLocation('<?php echo Mage::helper('adminhtml')->getUrl('adminhtml/clearapc/index')?>')" type="button" class="scalable">
13
+ <span><?php echo Mage::helper('adminhtml')->__('Flush APC Cache') ?></span>
14
+ </button>
15
+ </td>
16
+ <td class="scope-label">
17
+ <?php echo Mage::helper('adminhtml')->__('APC user and system cache.')?>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td class="scope-label">
22
+ <button onclick="setLocation('<?php echo $this->getCleanImagesUrl()?>')" type="button" class="scalable"><span><?php echo Mage::helper('adminhtml')->__('Flush Catalog Images Cache') ?></span></button>
23
+ </td>
24
+ <td class="scope-label">
25
+ <?php echo Mage::helper('adminhtml')->__('Pregenerated product images files.')?>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td class="scope-label">
30
+ <button onclick="setLocation('<?php echo $this->getCleanMediaUrl()?>')" type="button" class="scalable"><span><?php echo Mage::helper('adminhtml')->__('Flush JavaScript/CSS Cache') ?></span></button>
31
+ </td>
32
+ <td class="scope-label">
33
+ <?php echo Mage::helper('adminhtml')->__('Themes JavaScript and CSS files combined to one file.')?>
34
+ </td>
35
+ </tr>
36
+ </table>
37
+ <?php echo $this->getChildHtml(); ?>
app/etc/modules/Buric_Apc.xml ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Buric_Apc>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ <depends>
8
+ <Mage_Core />
9
+ </depends>
10
+ </Buric_Apc>
11
+ </modules>
12
+ </config>
package.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Buric_Apc</name>
4
+ <version>1.0.0.0</version>
5
+ <stability>stable</stability>
6
+ <license>GPL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Clear the APC cache from Cache management section in Magento admin panel.</summary>
10
+ <description>A button in the Cache management section in Magento admin panel. Clicking on the button clears APC cache.&#xD;
11
+ &lt;br /&gt;&#xD;
12
+ &lt;img src="http://inchoo.net/wp-content/uploads/2013/02/Cache-Management-System-Magento-Admin.png" /&gt;&#xD;
13
+ &lt;hr /&gt;&#xD;
14
+ &lt;a href="https://github.com/buric/Inchoo_Apc"&gt;GitHub Repository&lt;/a&gt;</description>
15
+ <notes>Initial</notes>
16
+ <authors><author><name>Zvonimir Buri&#x107;</name><user>buric</user><email>zvonimir.buric@gmail.com</email></author></authors>
17
+ <date>2014-03-04</date>
18
+ <time>11:46:34</time>
19
+ <contents><target name="magecommunity"><dir name="Buric"><dir name="Apc"><dir name="Model"><file name="Observer.php" hash="d488e59645b9540fd460b9db3fb85689"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ClearapcController.php" hash="a3804ae5ca022f47ad0d8e0578a3b249"/></dir></dir><dir name="etc"><file name="config.xml" hash="1afbc321e15cc05998a21346972462bd"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Buric_Apc.xml" hash="24095e61df9748e32487da144b2610b0"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="system"><dir name="cache"><file name="additional.phtml" hash="41ce6026425d351c5927bb30f61043c0"/></dir></dir></dir></dir></dir></dir></target></contents>
20
+ <compatible/>
21
+ <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
22
+ </package>