Version Notes
Fixed an issue causing zombie cron job observer reporting an error.
Download this release
Release Info
Developer | Arron Moss |
Extension | Zero1_Crondoctor |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.4 to 1.0.6
app/code/community/Zero1/Crondoctor/Model/Observer.php
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
<?php
|
2 |
-
class Zero1_Crondoctor_Model_Observer
|
3 |
{
|
4 |
const XML_PATH_ZOMBIE_EMAIL_TEMPLATE = 'zero1_crondoctor/settings/zombie_email_template';
|
5 |
const XML_PATH_ZOMBIE_EMAIL_TO = 'zero1_crondoctor/settings/zombie_email';
|
6 |
const XML_PATH_ZOMBIE_TIME = 'zero1_crondoctor/settings/zombie_time';
|
7 |
|
|
|
|
|
|
|
8 |
protected $_zombieEmailSubject = 'Magento Cron Doctor Zombie Report';
|
9 |
|
10 |
-
public function checkForZombieJobs(
|
11 |
{
|
12 |
$storeId = Mage::app()->getStore()->getId();
|
13 |
$to = Mage::getStoreConfig(self::XML_PATH_ZOMBIE_EMAIL_TO, $storeId);
|
@@ -58,4 +61,28 @@ class Zero1_Crondoctor_Model_Observer
|
|
58 |
$translate->setTranslateInline(true);
|
59 |
}
|
60 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
1 |
<?php
|
2 |
+
class Zero1_Crondoctor_Model_Observer extends Mage_Cron_Model_Observer
|
3 |
{
|
4 |
const XML_PATH_ZOMBIE_EMAIL_TEMPLATE = 'zero1_crondoctor/settings/zombie_email_template';
|
5 |
const XML_PATH_ZOMBIE_EMAIL_TO = 'zero1_crondoctor/settings/zombie_email';
|
6 |
const XML_PATH_ZOMBIE_TIME = 'zero1_crondoctor/settings/zombie_time';
|
7 |
|
8 |
+
const XML_PATH_DEVELOPER_MODE = 'zero1_crondoctor/settings/developer_mode';
|
9 |
+
const XML_PATH_DEVELOPER_MODE_JOBS = 'zero1_crondoctor/settings/developer_mode_jobs';
|
10 |
+
|
11 |
protected $_zombieEmailSubject = 'Magento Cron Doctor Zombie Report';
|
12 |
|
13 |
+
public function checkForZombieJobs($observer)
|
14 |
{
|
15 |
$storeId = Mage::app()->getStore()->getId();
|
16 |
$to = Mage::getStoreConfig(self::XML_PATH_ZOMBIE_EMAIL_TO, $storeId);
|
61 |
$translate->setTranslateInline(true);
|
62 |
}
|
63 |
}
|
64 |
+
|
65 |
+
protected function _generateJobs($jobs, $exists)
|
66 |
+
{
|
67 |
+
$devMode = Mage::getStoreConfig(self::XML_PATH_DEVELOPER_MODE);
|
68 |
+
$devModeJobs = Mage::getStoreConfig(self::XML_PATH_DEVELOPER_MODE_JOBS);
|
69 |
+
$devModeJobs = preg_replace('/[^a-z0-9_,]*/', '', $devModeJobs);
|
70 |
+
$devModeJobs = explode(',', $devModeJobs);
|
71 |
+
|
72 |
+
if ($devMode) {
|
73 |
+
$devJobs = array(); // By default, don't run anything if in dev mode.
|
74 |
+
|
75 |
+
if (is_array($devModeJobs) && count($devModeJobs) > 0) {
|
76 |
+
foreach ($jobs as $jobCode => $jobConfig) {
|
77 |
+
if (in_array($jobCode, $devModeJobs)) {
|
78 |
+
$devJobs[$jobCode] = $jobConfig;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
return parent::_generateJobs($devJobs, $exists);
|
84 |
+
}
|
85 |
+
|
86 |
+
return parent::_generateJobs($jobs, $exists);
|
87 |
+
}
|
88 |
}
|
app/code/community/Zero1/Crondoctor/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Zero1_Crondoctor>
|
5 |
-
<version>1.0.
|
6 |
</Zero1_Crondoctor>
|
7 |
</modules>
|
8 |
|
@@ -23,6 +23,12 @@
|
|
23 |
<zero1_crondoctor>
|
24 |
<class>Zero1_Crondoctor_Model</class>
|
25 |
</zero1_crondoctor>
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
</models>
|
27 |
|
28 |
<resources>
|
@@ -85,6 +91,8 @@
|
|
85 |
<zombie_email_template>zero1_crondoctor_settings_zombie_email_template</zombie_email_template>
|
86 |
<zombie_email></zombie_email>
|
87 |
<zombie_time>5</zombie_time>
|
|
|
|
|
88 |
</settings>
|
89 |
</zero1_crondoctor>
|
90 |
</default>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Zero1_Crondoctor>
|
5 |
+
<version>1.0.6</version>
|
6 |
</Zero1_Crondoctor>
|
7 |
</modules>
|
8 |
|
23 |
<zero1_crondoctor>
|
24 |
<class>Zero1_Crondoctor_Model</class>
|
25 |
</zero1_crondoctor>
|
26 |
+
|
27 |
+
<cron>
|
28 |
+
<rewrite>
|
29 |
+
<observer>Zero1_Crondoctor_Model_Observer</observer>
|
30 |
+
</rewrite>
|
31 |
+
</cron>
|
32 |
</models>
|
33 |
|
34 |
<resources>
|
91 |
<zombie_email_template>zero1_crondoctor_settings_zombie_email_template</zombie_email_template>
|
92 |
<zombie_email></zombie_email>
|
93 |
<zombie_time>5</zombie_time>
|
94 |
+
<developer_mode>0</developer_mode>
|
95 |
+
<developer_mode_jobs>send_notification,newsletter_send_all</developer_mode_jobs>
|
96 |
</settings>
|
97 |
</zero1_crondoctor>
|
98 |
</default>
|
app/code/community/Zero1/Crondoctor/etc/system.xml
CHANGED
@@ -47,6 +47,27 @@
|
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
</zombie_time>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
</fields>
|
51 |
</settings>
|
52 |
</groups>
|
47 |
<show_in_website>1</show_in_website>
|
48 |
<show_in_store>1</show_in_store>
|
49 |
</zombie_time>
|
50 |
+
|
51 |
+
<developer_mode translate="label comment">
|
52 |
+
<label>Developer mode</label>
|
53 |
+
<comment><![CDATA[If you are running a development server and only want the index based cron jobs to run then enable this.]]></comment>
|
54 |
+
<frontend_type>select</frontend_type>
|
55 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
56 |
+
<sort_order>4</sort_order>
|
57 |
+
<show_in_default>1</show_in_default>
|
58 |
+
<show_in_website>1</show_in_website>
|
59 |
+
<show_in_store>1</show_in_store>
|
60 |
+
</developer_mode>
|
61 |
+
|
62 |
+
<developer_mode_jobs translate="label comment">
|
63 |
+
<label>Developer mode jobs to run</label>
|
64 |
+
<comment><![CDATA[Comma separated cron job codes.]]></comment>
|
65 |
+
<frontend_type>text</frontend_type>
|
66 |
+
<sort_order>5</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
+
</developer_mode_jobs>
|
71 |
</fields>
|
72 |
</settings>
|
73 |
</groups>
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Zero1_Crondoctor</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
|
7 |
<channel>community</channel>
|
@@ -9,11 +9,11 @@
|
|
9 |
<summary>Crondoctor</summary>
|
10 |
<description>Crondoctor
|
11 |
</description>
|
12 |
-
<notes>
|
13 |
<authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
|
14 |
-
<date>2013-
|
15 |
-
<time>10:
|
16 |
-
<contents><target name="magecommunity"><dir name="Zero1"><dir name="Crondoctor"><dir name="Block"><dir name="Adminhtml"><dir name="Crondoctor"><file name="Grid.php" hash="ff758796ef8d66b388e0b1d60d73f92e"/><file name="Notice.php" hash="6b4c20f69f875fa3410a34acc8d2209a"/></dir><file name="Crondoctor.php" hash="6fa8fd6eee1dd35d9b82f861238738c1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4b85072f6909ba3f083c99814103a92a"/></dir><dir name="Model"><file name="Observer.php" hash="
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Zero1_Crondoctor</name>
|
4 |
+
<version>1.0.6</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
|
7 |
<channel>community</channel>
|
9 |
<summary>Crondoctor</summary>
|
10 |
<description>Crondoctor
|
11 |
</description>
|
12 |
+
<notes>Fixed an issue causing zombie cron job observer reporting an error.</notes>
|
13 |
<authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
|
14 |
+
<date>2013-10-14</date>
|
15 |
+
<time>15:10:56</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Zero1"><dir name="Crondoctor"><dir name="Block"><dir name="Adminhtml"><dir name="Crondoctor"><file name="Grid.php" hash="ff758796ef8d66b388e0b1d60d73f92e"/><file name="Notice.php" hash="6b4c20f69f875fa3410a34acc8d2209a"/></dir><file name="Crondoctor.php" hash="6fa8fd6eee1dd35d9b82f861238738c1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="4b85072f6909ba3f083c99814103a92a"/></dir><dir name="Model"><file name="Observer.php" hash="0ff5bde873ad40ade469820909d1a723"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="CrondoctorController.php" hash="209983731264467ce1c2d3d7989039ac"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="56bcc9e463c033655658d711e3549636"/><file name="config.xml" hash="cf5de2ed2d1e978776171b09b63b8f2b"/><file name="system.xml" hash="0ab03980d1259c4d0a497020ca707baf"/></dir><dir name="sql"><dir name="zero1_crondoctor_setup"><file name="install-1.0.0.php" hash="af6b55e68b5c327efcf58452719d359e"/><file name="mysql4-install-1.0.0.php" hash="af6b55e68b5c327efcf58452719d359e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zero1_Crondoctor.xml" hash="3ccefc4ae6efeecc2bfd7df6a59264f1"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="crondoctor"><file name="crondoctor.xml" hash="61e541ccd7156e8e7dad6197792b4315"/></dir></dir><dir name="template"><dir name="crondoctor"><file name="notice.phtml" hash="95575d8f09e623c05c0de950677346ce"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><file name="crondoctor_zombieemail.html" hash="ad7b0695ba42ddaea95e50b8d9859370"/></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
19 |
</package>
|