Yireo_DisableLog - Version 0.0.2

Version Notes

No notes

Download this release

Release Info

Developer Yireo
Extension Yireo_DisableLog
Version 0.0.2
Comparing to
See all releases


Version 0.0.2

app/code/community/Yireo/DisableLog/Helper/Data.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Yireo DisableLog for Magento
4
+ *
5
+ * @package Yireo_DisableLog
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2013 Yireo (http://www.yireo.com/)
8
+ * @license Open Software License
9
+ */
10
+
11
+ /**
12
+ * DisableLog helper
13
+ */
14
+ class Yireo_DisableLog_Helper_Data extends Mage_Core_Helper_Abstract
15
+ {
16
+ /*
17
+ * Helper-method to determine whether this module is enabled or not
18
+ *
19
+ * @access public
20
+ * @param null
21
+ * @return bool
22
+ */
23
+ public function enabled()
24
+ {
25
+ return (bool)Mage::getStoreConfig('disablelog/settings/enabled');
26
+ }
27
+ }
app/code/community/Yireo/DisableLog/Model/Rewrite/Catalogsearch/Query.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Yireo DisableLog for Magento
4
+ *
5
+ * @package Yireo_DisableLog
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2013 Yireo (http://www.yireo.com/)
8
+ * @license Open Software License
9
+ */
10
+
11
+ class Yireo_DisableLog_Model_Rewrite_Catalogsearch_Query extends Mage_CatalogSearch_Model_Query
12
+ {
13
+ /**
14
+ * Onject initialization
15
+ */
16
+ protected function setPopularity($popularity)
17
+ {
18
+ // If module is disabled
19
+ if((bool)Mage::getStoreConfig('disablelog/settings/enabled') == false) {
20
+ return parent::setPopularity($popularity);
21
+ }
22
+
23
+ // Disable search-hitting for user-agents
24
+ $userAgent = Mage::helper('core/http')->getHttpUserAgent();
25
+ $ignoreAgents = Mage::getConfig()->getNode('global/skip_user_agents');
26
+ if ($ignoreAgents) {
27
+ $ignoreAgents = $ignoreAgents->asArray();
28
+ foreach($ignoreAgents as $ignoreAgent) {
29
+ if (stristr($userAgent, $ignoreAgent)) {
30
+ return false;
31
+ }
32
+ }
33
+ }
34
+
35
+ return parent::setPopularity($popularity);
36
+ }
37
+ }
app/code/community/Yireo/DisableLog/Model/Rewrite/Log/Visitor.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Yireo DisableLog for Magento
4
+ *
5
+ * @package Yireo_DisableLog
6
+ * @author Yireo (http://www.yireo.com/)
7
+ * @copyright Copyright (c) 2013 Yireo (http://www.yireo.com/)
8
+ * @license Open Software License
9
+ */
10
+
11
+ class Yireo_DisableLog_Model_Rewrite_Log_Visitor extends Mage_Log_Model_Visitor
12
+ {
13
+ /**
14
+ * Object initialization
15
+ */
16
+ protected function _construct()
17
+ {
18
+ // Call upon the parent constructor
19
+ $rt = parent::_construct();
20
+
21
+ // If module is disabled
22
+ if((bool)Mage::getStoreConfig('disablelog/settings/enabled') == false) {
23
+ return $rt;
24
+ }
25
+
26
+ // Check disable_all flag
27
+ $this->_skipRequestLogging = (bool)Mage::getStoreConfig('disablelog/settings/disable_all');
28
+
29
+ // Check if logging should be disabled for a specific user-agent
30
+ if($this->_skipRequestLogging == false) {
31
+ $userAgent = Mage::helper('core/http')->getHttpUserAgent();
32
+ $ignoreAgents = Mage::getConfig()->getNode('global/skip_user_agents');
33
+ if ($ignoreAgents) {
34
+ $ignoreAgents = $ignoreAgents->asArray();
35
+ foreach($ignoreAgents as $ignoreAgent) {
36
+ if (stristr($userAgent, $ignoreAgent)) {
37
+ $this->_skipRequestLogging = true;
38
+ break;
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ return $rt;
45
+ }
46
+ }
app/code/community/Yireo/DisableLog/etc/config.xml ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Yireo DisableLog for Magento
5
+ *
6
+ * @package Yireo_DisableLog
7
+ * @author Yireo (http://www.yireo.com/)
8
+ * @copyright Copyright (c) 2013 Yireo (http://www.yireo.com/)
9
+ * @license Open Software License
10
+ */
11
+ -->
12
+ <config>
13
+
14
+ <modules>
15
+ <Yireo_DisableLog>
16
+ <version>0.0.2</version>
17
+ </Yireo_DisableLog>
18
+ </modules>
19
+
20
+ <global>
21
+ <helpers>
22
+ <disablelog>
23
+ <class>Yireo_DisableLog_Helper</class>
24
+ </disablelog>
25
+ </helpers>
26
+
27
+ <models>
28
+ <disablelog>
29
+ <class>Yireo_DisableLog_Model</class>
30
+ </disablelog>
31
+ <log>
32
+ <rewrite>
33
+ <visitor>Yireo_DisableLog_Model_Rewrite_Log_Visitor</visitor>
34
+ </rewrite>
35
+ </log>
36
+ <catalogsearch>
37
+ <rewrite>
38
+ <query>Yireo_DisableLog_Model_Rewrite_Catalogsearch_Query</query>
39
+ </rewrite>
40
+ </catalogsearch>
41
+ </models>
42
+
43
+ <skip_user_agents>
44
+ <appengine>AppEngine-Google</appengine>
45
+ <bingbot>bingbot</bingbot>
46
+ <googlebot>Googlebot</googlebot>
47
+ <pingdom>Pingdom.com_bot_version</pingdom>
48
+ <hosttracker>HostTracker.com</hosttracker>
49
+ <yahoo>ysearch/slurp</yahoo>
50
+ <baidu>Baiduspider</baidu>
51
+ <yandex>YandexBot</yandex>
52
+ <socialmedia>SocialMedia Bot</socialmedia>
53
+ <exabot>Exabot</exabot>
54
+ <soso>Sosospider+</soso>
55
+ <tweetmeme>TweetmemeBot</tweetmeme>
56
+ <comodo1>Comodo-Certificates-Spider</comodo1>
57
+ <comodo2>Comodo SSL Checker</comodo2>
58
+ <speedy>Speedy Spider</speedy>
59
+ <twitter>Twitterbot/0.1</twitter>
60
+ <sitespeed>SiteSpeedBot</sitespeed>
61
+ <zooka>Zookabot/2.1;++http://zookabot.com</zooka>
62
+ <njuice>NjuiceBot</njuice>
63
+ <friendfeed>FriendFeedBot/0.1</friendfeed>
64
+ <huawei>Huaweisymantecspider</huawei>
65
+ <docomo>DoCoMo/2.0</docomo>
66
+ <msn>msnbot/</msn>
67
+ <worio>woriobot support</worio>
68
+ <archiver>ia_archiver</archiver>
69
+ <passwordthumbs>1PasswordThumbs</passwordthumbs>
70
+ <twingly>Twingly Recon</twingly>
71
+ <tlsprober>TLSProber/0.1</tlsprober>
72
+ <postrank>PostRank/2.0 (postrank.com)</postrank>
73
+ <jskit1>JS-Kit URL Resolver, http://js-kit.com/</jskit1>
74
+ <dotnetcom>dotnetdotcom.org</dotnetcom>
75
+ <gigabot>Gigabot/</gigabot>
76
+ <search17>Search17Bot</search17>
77
+ <mj12>MJ12bot</mj12>
78
+ <misc>Bot,Robot,Spider,Crawler</misc>
79
+ <discobot>discobot/</discobot>
80
+ <legs80>80legs.com/webcrawler</legs80>
81
+ <kiwistatus>KiwiStatus/</kiwistatus>
82
+ <dps>PXHOST</dps>
83
+ <pycurl>PycURL/</pycurl>
84
+ <voyager>Voyager/</voyager>
85
+ <dowjones>Dow Jones Searchbot</dowjones>
86
+ </skip_user_agents>
87
+ </global>
88
+
89
+ <adminhtml>
90
+ <translate>
91
+ <modules>
92
+ <Yireo_DisableLog>
93
+ <files>
94
+ <default>Yireo_DisableLog.csv</default>
95
+ </files>
96
+ </Yireo_DisableLog>
97
+ </modules>
98
+ </translate>
99
+ <acl>
100
+ <resources>
101
+ <admin>
102
+ <children>
103
+ <system>
104
+ <children>
105
+ <config>
106
+ <children>
107
+ <disablelog translate="title" module="disabelog">
108
+ <title>DisableLog Section</title>
109
+ </disablelog>
110
+ </children>
111
+ </config>
112
+ </children>
113
+ </system>
114
+ </children>
115
+ </admin>
116
+ </resources>
117
+ </acl>
118
+ </adminhtml>
119
+
120
+ <default>
121
+ <disablelog>
122
+ <settings>
123
+ <enabled>1</enabled>
124
+ <disable_all>0</disable_all>
125
+ </settings>
126
+ </disablelog>
127
+ </default>
128
+ </config>
app/code/community/Yireo/DisableLog/etc/system.xml ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Yireo DisableLog for Magento
5
+ *
6
+ * @package Yireo_DisableLog
7
+ * @author Yireo (http://www.yireo.com/)
8
+ * @copyright Copyright (c) 2012 Yireo (http://www.yireo.com/)
9
+ * @license Open Software License
10
+ */
11
+ -->
12
+ <config>
13
+ <sections>
14
+ <disablelog translate="label" module="disablelog">
15
+ <label>Yireo DisableLog</label>
16
+ <tab>advanced</tab>
17
+ <frontend_type>text</frontend_type>
18
+ <sort_order>98</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>1</show_in_store>
22
+ <groups>
23
+ <settings translate="label">
24
+ <label>Settings</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>900</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ <fields>
31
+ <enabled translate="label">
32
+ <label>Enabled</label>
33
+ <frontend_type>select</frontend_type>
34
+ <source_model>adminhtml/system_config_source_yesno</source_model>
35
+ <sort_order>1</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>1</show_in_store>
39
+ </enabled>
40
+ <disable_all translate="label">
41
+ <label>Disable All Logs</label>
42
+ <frontend_type>select</frontend_type>
43
+ <source_model>adminhtml/system_config_source_yesno</source_model>
44
+ <sort_order>2</sort_order>
45
+ <show_in_default>1</show_in_default>
46
+ <show_in_website>1</show_in_website>
47
+ <show_in_store>1</show_in_store>
48
+ </disable_all>
49
+ </fields>
50
+ </settings>
51
+ </groups>
52
+ </disablelog>
53
+ </sections>
54
+ </config>
app/etc/modules/Yireo_DisableLog.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Yireo DisableLog-module for Magento
5
+ *
6
+ * @package Yireo_DisableLog
7
+ * @author Yireo (http://www.yireo.com/)
8
+ * @copyright Copyright (c) 2013 Yireo (http://www.yireo.com/)
9
+ * @license Open Software License
10
+ */
11
+ -->
12
+ <config>
13
+ <modules>
14
+ <Yireo_DisableLog>
15
+ <active>false</active>
16
+ <codePool>community</codePool>
17
+ <depends>
18
+ <Mage_Core />
19
+ <Mage_Log />
20
+ </depends>
21
+ </Yireo_DisableLog>
22
+ </modules>
23
+ </config>
package.xml ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?xml version="1.0"?>
2
+ <package><name>Yireo_DisableLog</name><version>0.0.2</version><stability>stable</stability><license>Open Source License</license><channel>community</channel><extends></extends><summary>No summary</summary><description>No description</description><notes>No notes</notes><authors><author><name>Yireo</name><user>yireo</user><email>info@yireo.com</email></author></authors><date>2013-05-13</date><time>4:58:03</time><compatible></compatible><dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies><contents><target name="mage"><dir name="app"><dir name="etc"><dir name="modules"><file name="Yireo_DisableLog.xml" hash="9d9cb7d1b12163baca90b08afa292882"/></dir></dir><dir name="code"><dir name="community"><dir name="Yireo"><dir name="DisableLog"><dir name="etc"><file name="config.xml" hash="1a8a1be3d5bb5172ed5f34f4ca52f99f"/><file name="system.xml" hash="66c07d087dd0f8499332378db576d1ff"/></dir><dir name="Helper"><file name="Data.php" hash="b5a84b5d039ecc1e09286584aeb1ba29"/></dir><dir name="Model"><dir name="Rewrite"><dir name="Log"><file name="Visitor.php" hash="d2428f2ec4d3a6e8f2ab77d32ce0a86f"/></dir><dir name="Catalogsearch"><file name="Query.php" hash="347b4a45d3b72d0d400cd16862a40ef3"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents></package>