Aoe_Scheduler - Version 0.3.1

Version Notes

GIT Revision: 5831049ed3c4f99a32351649ed5599c15d3a5192, Build Date: 2013-02-28 22:29:19

Download this release

Release Info

Developer Fabrizio Branca
Extension Aoe_Scheduler
Version 0.3.1
Comparing to
See all releases


Code changes from version 0.2.2 to 0.3.1

app/code/local/Aoe/Scheduler/Block/Adminhtml/Cron.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Cron block
5
- *
6
- * @author Fabrizio Branca
7
- */
8
- class Aoe_Scheduler_Block_Adminhtml_Cron extends Mage_Adminhtml_Block_Widget_Grid_Container {
9
-
10
-
11
-
12
- /**
13
- * Constructor for Cron Adminhtml Block
14
- */
15
- public function __construct() {
16
- $this->_blockGroup = 'aoe_scheduler';
17
- $this->_controller = 'adminhtml_cron';
18
- $this->_headerText = Mage::helper('aoe_scheduler')->__('Available tasks');
19
- parent::__construct();
20
- }
21
-
22
-
23
-
24
- /**
25
- * Prepare layout
26
- *
27
- * @return Aoe_Scheduler_Block_Adminhtml_Cron
28
- */
29
- protected function _prepareLayout() {
30
- $this->removeButton('add');
31
- $this->_addButton('add_new', array(
32
- 'label' => Mage::helper('aoe_scheduler')->__('Generate Schedule'),
33
- 'onclick' => "setLocation('{$this->getUrl('*/*/generateSchedule')}')",
34
- ));
35
- $this->_addButton('configure', array(
36
- 'label' => Mage::helper('aoe_scheduler')->__('Cron Configuration'),
37
- 'onclick' => "setLocation('{$this->getUrl('adminhtml/system_config/edit', array('section' => 'system'))}#system_cron')",
38
- ));
39
- return parent::_prepareLayout();
40
- }
41
-
42
-
43
-
44
- /**
45
- * Returns the CSS class for the header
46
- *
47
- * Usually 'icon-head' and a more precise class is returned. We return
48
- * only an empty string to avoid spacing on the left of the header as we
49
- * don't have an icon.
50
- *
51
- * @return string
52
- */
53
- public function getHeaderCssClass() {
54
- return '';
55
- }
56
-
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Block/Adminhtml/Cron/Grid.php DELETED
@@ -1,138 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Block: Cron grid
5
- *
6
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
7
- */
8
- class Aoe_Scheduler_Block_Adminhtml_Cron_Grid extends Mage_Adminhtml_Block_Widget_Grid {
9
-
10
-
11
-
12
- /**
13
- * Constructor
14
- */
15
- public function __construct() {
16
- parent::__construct();
17
- $this->setId('cron_grid');
18
- $this->_filterVisibility = false;
19
- $this->_pagerVisibility = false;
20
- }
21
-
22
-
23
-
24
- /**
25
- * Preparation of the data that is displayed by the grid.
26
- *
27
- * @return Aoe_Scheduler_Block_Adminhtml_Cron_Grid Self
28
- */
29
- protected function _prepareCollection() {
30
- $collection = Mage::getModel('aoe_scheduler/collection_crons');
31
- $this->setCollection($collection);
32
- return parent::_prepareCollection();
33
- }
34
-
35
-
36
-
37
- /**
38
- * Add mass-actions to grid
39
- *
40
- * @return Aoe_Scheduler_Block_Adminhtml_Cron_Grid
41
- */
42
- protected function _prepareMassaction() {
43
- $this->setMassactionIdField('id');
44
- $this->getMassactionBlock()->setFormFieldName('codes');
45
- $this->getMassactionBlock()->addItem('schedule', array(
46
- 'label' => Mage::helper('aoe_scheduler')->__('Schedule now'),
47
- 'url' => $this->getUrl('*/*/scheduleNow'),
48
- ));
49
- $this->getMassactionBlock()->addItem('run', array(
50
- 'label' => Mage::helper('aoe_scheduler')->__('Run now'),
51
- 'url' => $this->getUrl('*/*/runNow'),
52
- ));
53
- $this->getMassactionBlock()->addItem('disable', array(
54
- 'label' => Mage::helper('aoe_scheduler')->__('Disable'),
55
- 'url' => $this->getUrl('*/*/disable'),
56
- ));
57
- $this->getMassactionBlock()->addItem('enable', array(
58
- 'label' => Mage::helper('aoe_scheduler')->__('Enable'),
59
- 'url' => $this->getUrl('*/*/enable'),
60
- ));
61
- return $this;
62
- }
63
-
64
-
65
-
66
- /**
67
- * Preparation of the requested columns of the grid
68
- *
69
- * @return Aoe_Scheduler_Block_Adminhtml_Cron_Grid Self
70
- */
71
- protected function _prepareColumns() {
72
- $this->addColumn('id', array (
73
- 'header' => Mage::helper('aoe_scheduler')->__('Code'),
74
- 'index' => 'id',
75
- 'sortable' => false,
76
- ));
77
- $this->addColumn('cron_expr', array (
78
- 'header' => Mage::helper('aoe_scheduler')->__('Cron Expression'),
79
- 'index' => 'cron_expr',
80
- 'sortable' => false,
81
- ));
82
- $this->addColumn('model', array (
83
- 'header' => Mage::helper('aoe_scheduler')->__('Model'),
84
- 'index' => 'model',
85
- 'sortable' => false,
86
- ));
87
- $this->addColumn('status', array (
88
- 'header' => Mage::helper('aoe_scheduler')->__('Status'),
89
- 'index' => 'status',
90
- 'sortable' => false,
91
- 'frame_callback' => array($this, 'decorateStatus'),
92
- ));
93
- return parent::_prepareColumns();
94
- }
95
-
96
-
97
-
98
- /**
99
- * Decorate status column values
100
- *
101
- * @return string
102
- */
103
- public function decorateStatus($value) {
104
- $cell = sprintf('<span class="grid-severity-%s"><span>%s</span></span>',
105
- ($value == Aoe_Scheduler_Model_Configuration::STATUS_DISABLED) ? 'critical' : 'notice',
106
- Mage::helper('aoe_scheduler')->__($value)
107
- );
108
- return $cell;
109
- }
110
-
111
-
112
-
113
- /**
114
- * Helper function to add store filter condition
115
- *
116
- * @param Mage_Core_Model_Mysql4_Collection_Abstract $collection Data collection
117
- * @param Mage_Adminhtml_Block_Widget_Grid_Column $column Column information to be filtered
118
- * @return void
119
- */
120
- protected function _filterStoreCondition($collection, $column) {
121
- if (!$value = $column->getFilter()->getValue()) {
122
- return;
123
- }
124
- $this->getCollection()->addStoreFilter($value);
125
- }
126
-
127
-
128
-
129
- /**
130
- * Helper function to receive grid functionality urls for current grid
131
- *
132
- * @return string Requested URL
133
- */
134
- public function getGridUrl() {
135
- return $this->getUrl('adminhtml/scheduler/cron', array('_current' => true));
136
- }
137
-
138
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Block/Adminhtml/Scheduler.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Scheduler Block
5
- *
6
- * @author Fabrizio Branca
7
- */
8
- class Aoe_Scheduler_Block_Adminhtml_Scheduler extends Mage_Adminhtml_Block_Widget_Grid_Container {
9
-
10
-
11
-
12
- /**
13
- * Constructor for Scheduler Adminhtml Block
14
- */
15
- public function __construct() {
16
- $this->_blockGroup = 'aoe_scheduler';
17
- $this->_controller = 'adminhtml_scheduler';
18
- $this->_headerText = Mage::helper('aoe_scheduler')->__('Scheduled tasks');
19
- parent::__construct();
20
- }
21
-
22
-
23
-
24
- /**
25
- * Prepare layout
26
- *
27
- * @return Aoe_Scheduler_Block_Adminhtml_Cron
28
- */
29
- protected function _prepareLayout() {
30
- $this->removeButton('add');
31
- $this->_addButton('add_new', array(
32
- 'label' => Mage::helper('aoe_scheduler')->__('Generate Schedule'),
33
- 'onclick' => "setLocation('{$this->getUrl('*/*/generateSchedule')}')",
34
- ));
35
- $this->_addButton('configure', array(
36
- 'label' => Mage::helper('aoe_scheduler')->__('Cron Configuration'),
37
- 'onclick' => "setLocation('{$this->getUrl('adminhtml/system_config/edit', array('section' => 'system'))}#system_cron')",
38
- ));
39
- return parent::_prepareLayout();
40
- }
41
-
42
-
43
-
44
- /**
45
- * Returns the CSS class for the header
46
- *
47
- * Usually 'icon-head' and a more precise class is returned. We return
48
- * only an empty string to avoid spacing on the left of the header as we
49
- * don't have an icon.
50
- *
51
- * @return string
52
- */
53
- public function getHeaderCssClass() {
54
- return '';
55
- }
56
-
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Block/Adminhtml/Scheduler/Grid.php DELETED
@@ -1,170 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Block: Scheduler Grid
5
- *
6
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
7
- */
8
- class Aoe_Scheduler_Block_Adminhtml_Scheduler_Grid extends Mage_Adminhtml_Block_Widget_Grid {
9
-
10
-
11
-
12
- /**
13
- * Constructor. Set basic parameters
14
- */
15
- public function __construct() {
16
- parent::__construct();
17
- $this->setId('scheduler_grid');
18
- $this->setUseAjax(false);
19
- $this->setDefaultSort('scheduled_at');
20
- $this->setDefaultDir('DESC');
21
- $this->setSaveParametersInSession(true);
22
- }
23
-
24
-
25
-
26
- /**
27
- * Preparation of the data that is displayed by the grid.
28
- *
29
- * @return Aoe_SourceContact_Block_Admin_Grid Self
30
- */
31
- protected function _prepareCollection() {
32
- $collection = Mage::getModel('cron/schedule')->getCollection();
33
- $this->setCollection($collection);
34
- return parent::_prepareCollection();
35
- }
36
-
37
-
38
-
39
- /**
40
- * Add mass-actions to grid
41
- *
42
- * @return Aoe_Scheduler_Block_Adminhtml_Cron_Grid
43
- */
44
- protected function _prepareMassaction() {
45
- $this->setMassactionIdField('schedule_id');
46
- $this->getMassactionBlock()->setFormFieldName('schedule_ids');
47
- $this->getMassactionBlock()->addItem('delete', array(
48
- 'label' => Mage::helper('aoe_scheduler')->__('Delete'),
49
- 'url' => $this->getUrl('*/*/delete'),
50
- ));
51
- return $this;
52
- }
53
-
54
-
55
-
56
- /**
57
- * Preparation of the requested columns of the grid
58
- *
59
- * @return Aoe_SourceContact_Block_Admin_Grid Self
60
- */
61
- protected function _prepareColumns() {
62
-
63
- $viewHelper = $this->helper('aoe_scheduler/data');
64
-
65
- $this->addColumn('job_code', array (
66
- 'header' => Mage::helper('aoe_scheduler')->__('Code'),
67
- 'index' => 'job_code',
68
- 'type' => 'options',
69
- 'options' => Mage::getModel('aoe_scheduler/collection_crons')->toOptionHash()
70
- ));
71
- $this->addColumn('created_at', array (
72
- 'header' => Mage::helper('aoe_scheduler')->__('Created'),
73
- 'index' => 'created_at',
74
- 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
75
- ));
76
- $this->addColumn('scheduled_at', array (
77
- 'header' => Mage::helper('aoe_scheduler')->__('Scheduled'),
78
- 'index' => 'scheduled_at',
79
- 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
80
- ));
81
- $this->addColumn('executed_at', array (
82
- 'header' => Mage::helper('aoe_scheduler')->__('Executed'),
83
- 'index' => 'executed_at',
84
- 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
85
- ));
86
- $this->addColumn('finished_at', array (
87
- 'header' => Mage::helper('aoe_scheduler')->__('Finished'),
88
- 'index' => 'finished_at',
89
- 'frame_callback' => array($viewHelper, 'decorateTimeFrameCallBack')
90
- ));
91
- $this->addColumn('messages', array (
92
- 'header' => Mage::helper('aoe_scheduler')->__('Messages'),
93
- 'index' => 'messages',
94
- 'frame_callback' => array($this, 'decorateMessages')
95
- ));
96
- $this->addColumn('status', array (
97
- 'header' => Mage::helper('aoe_scheduler')->__('Status'),
98
- 'index' => 'status',
99
- 'frame_callback' => array($viewHelper, 'decorateStatus'),
100
- 'type' => 'options',
101
- 'options' => array(
102
- Mage_Cron_Model_Schedule::STATUS_PENDING => Mage_Cron_Model_Schedule::STATUS_PENDING,
103
- Mage_Cron_Model_Schedule::STATUS_SUCCESS => Mage_Cron_Model_Schedule::STATUS_SUCCESS,
104
- Mage_Cron_Model_Schedule::STATUS_ERROR => Mage_Cron_Model_Schedule::STATUS_ERROR,
105
- Mage_Cron_Model_Schedule::STATUS_MISSED => Mage_Cron_Model_Schedule::STATUS_MISSED,
106
- Mage_Cron_Model_Schedule::STATUS_RUNNING => Mage_Cron_Model_Schedule::STATUS_RUNNING,
107
- )
108
- ));
109
-
110
- return parent::_prepareColumns();
111
- }
112
-
113
-
114
-
115
- /**
116
- * Decorate message
117
- *
118
- * @param string $value
119
- * @param Aoe_Scheduler_Model_Schedule $row
120
- * @return string
121
- */
122
- public function decorateMessages($value, Aoe_Scheduler_Model_Schedule $row) {
123
- $return = '';
124
- if (!empty($value)) {
125
- $return .= '<a href="#" onclick="$(\'messages_'.$row->getScheduleId().'\').toggle(); return false;">'.Mage::helper('aoe_scheduler')->__('Message').'</a>';
126
- $return .= '<div class="schedule-message" id="messages_'.$row->getScheduleId().'" style="display: none; width: 300px; overflow: auto; font-size: small;"><pre>'.$value.'</pre></div>';
127
- }
128
- return $return;
129
- }
130
-
131
-
132
-
133
- /**
134
- * Helper function to do after load modifications
135
- *
136
- * @return void
137
- */
138
- protected function _afterLoadCollection() {
139
- $this->getCollection()->walk('afterLoad');
140
- parent::_afterLoadCollection();
141
- }
142
-
143
-
144
-
145
- /**
146
- * Helper function to add store filter condition
147
- *
148
- * @param Mage_Core_Model_Mysql4_Collection_Abstract $collection Data collection
149
- * @param Mage_Adminhtml_Block_Widget_Grid_Column $column Column information to be filtered
150
- * @return void
151
- */
152
- protected function _filterStoreCondition($collection, $column) {
153
- if (!$value = $column->getFilter()->getValue()) {
154
- return;
155
- }
156
- $this->getCollection()->addStoreFilter($value);
157
- }
158
-
159
-
160
-
161
- /**
162
- * Helper function to receive grid functionality urls for current grid
163
- *
164
- * @return string Requested URL
165
- */
166
- public function getGridUrl() {
167
- return $this->getUrl('adminhtml/scheduler/index', array('_current' => true));
168
- }
169
-
170
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Block/Adminhtml/Timeline.php DELETED
@@ -1,211 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Timeline block
5
- *
6
- * @author Fabrizio Branca
7
- */
8
- class Aoe_Scheduler_Block_Adminhtml_Timeline extends Mage_Adminhtml_Block_Widget_Container {
9
-
10
- /**
11
- * @var int amount of seconds per pixel
12
- */
13
- protected $zoom = 15;
14
-
15
- /**
16
- * @var int starttime
17
- */
18
- protected $starttime;
19
-
20
- /**
21
- * @var int endtime
22
- */
23
- protected $endtime;
24
-
25
- /**
26
- * @var array schedules
27
- */
28
- protected $schedules = array();
29
-
30
-
31
-
32
- /**
33
- * Constructor
34
- *
35
- * @return void
36
- */
37
- protected function _construct() {
38
- $this->_headerText = Mage::helper('aoe_scheduler')->__('Scheduler Timeline');
39
- $this->loadSchedules();
40
- parent::_construct();
41
- }
42
-
43
-
44
-
45
- /**
46
- * Prepare layout
47
- *
48
- * @return Aoe_Scheduler_Block_Adminhtml_Cron
49
- */
50
- protected function _prepareLayout() {
51
- $this->removeButton('add');
52
- $this->_addButton('add_new', array(
53
- 'label' => Mage::helper('aoe_scheduler')->__('Generate Schedule'),
54
- 'onclick' => "setLocation('{$this->getUrl('*/*/generateSchedule')}')",
55
- ));
56
- $this->_addButton('configure', array(
57
- 'label' => Mage::helper('aoe_scheduler')->__('Cron Configuration'),
58
- 'onclick' => "setLocation('{$this->getUrl('adminhtml/system_config/edit', array('section' => 'system'))}#system_cron')",
59
- ));
60
- return parent::_prepareLayout();
61
- }
62
-
63
-
64
-
65
- /**
66
- * Return the last full houd
67
- *
68
- * @param int $timestamp
69
- * @return int
70
- */
71
- protected function hourFloor($timestamp) {
72
- return mktime(date('H', $timestamp), 0, 0, date('n', $timestamp), date('j', $timestamp), date('Y', $timestamp));
73
- }
74
-
75
-
76
-
77
- /**
78
- * Returns the next full hour
79
- *
80
- * @param int $timestamp
81
- * @return int
82
- */
83
- protected function hourCeil($timestamp) {
84
- return mktime(date('H', $timestamp)+1, 0, 0, date('n', $timestamp), date('j', $timestamp), date('Y', $timestamp));
85
- }
86
-
87
-
88
-
89
- /**
90
- * Load schedules
91
- *
92
- * @return void
93
- */
94
- protected function loadSchedules() {
95
- $collection = Mage::getModel('cron/schedule')->getCollection(); /* @var $collection Mage_Cron_Model_Mysql4_Schedule_Collection */
96
-
97
- $minDate = null; $maxDate = null;
98
-
99
- foreach ($collection as $schedule) { /* @var $schedule Aoe_Scheduler_Model_Schedule */
100
- $startTime = $schedule->getStarttime();
101
- $minDate = is_null($minDate) ? $startTime : min($minDate, $startTime);
102
- $maxDate = is_null($maxDate) ? $startTime : max($maxDate, $startTime);
103
- $this->schedules[$schedule->getJobCode()][] = $schedule;
104
- }
105
-
106
- $this->starttime = $this->hourFloor(strtotime($minDate));
107
- $this->endtime = $this->hourCeil(strtotime($maxDate));
108
- }
109
-
110
-
111
-
112
- /**
113
- * Get timeline panel width
114
- *
115
- * @return int
116
- */
117
- public function getTimelinePanelWidth() {
118
- return ($this->endtime - $this->starttime) / $this->zoom;
119
- }
120
-
121
-
122
-
123
- /**
124
- * Get "now" line
125
- *
126
- * @return float
127
- */
128
- public function getNowline() {
129
- return (time() - $this->starttime) / $this->zoom;
130
- }
131
-
132
-
133
-
134
- /**
135
- * Get all available job codes
136
- *
137
- * @return array
138
- */
139
- public function getAvailableJobCodes() {
140
- return array_keys($this->schedules);
141
- }
142
-
143
-
144
-
145
- /**
146
- * Get schedules for given code
147
- *
148
- * @param string $code
149
- * @return array
150
- */
151
- public function getSchedulesForCode($code) {
152
- return $this->schedules[$code];
153
- }
154
-
155
-
156
-
157
- /**
158
- * Get starttime
159
- *
160
- * @return int
161
- */
162
- public function getStarttime() {
163
- return $this->starttime;
164
- }
165
-
166
-
167
-
168
- /**
169
- * Get endtime
170
- *
171
- * @return int
172
- */
173
- public function getEndtime() {
174
- return $this->endtime;
175
- }
176
-
177
-
178
-
179
- /**
180
- * Get attributes for div representing a gantt element
181
- *
182
- * @param Aoe_Scheduler_Model_Schedule $schedule
183
- * @return string
184
- */
185
- public function getGanttDivAttributes(Aoe_Scheduler_Model_Schedule $schedule) {
186
-
187
- if ($schedule->getStatus() == Mage_Cron_Model_Schedule::STATUS_RUNNING) {
188
- $duration = time() - strtotime($schedule->getExecutedAt());
189
- } else {
190
- $duration = $schedule->getDuration() ? $schedule->getDuration() : 0;
191
- }
192
- $duration = $duration / $this->zoom;
193
- $duration = ceil($duration / 4) * 4 - 1; // round to numbers dividable by 4, then remove 1 px border
194
- $duration = max($duration, 3);
195
-
196
- $offset = (strtotime($schedule->getStarttime()) - $this->starttime) / $this->zoom;
197
-
198
- if ($offset < 0) { // cut bar
199
- $duration += $offset;
200
- $offset = 0;
201
- }
202
-
203
- return sprintf('class="task %s" id="id_%s" style="width: %spx; left: %spx;"',
204
- $schedule->getStatus(),
205
- $schedule->getScheduleId(),
206
- $duration,
207
- $offset
208
- );
209
- }
210
-
211
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Block/Adminhtml/TimelineDetail.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * TimelineDetail block
5
- *
6
- * @author Fabrizio Branca
7
- */
8
- class Aoe_Scheduler_Block_Adminhtml_TimelineDetail extends Mage_Adminhtml_Block_Template {
9
-
10
- /**
11
- * @var string path to default template
12
- */
13
- protected $_template = 'aoe_scheduler/timeline_detail.phtml';
14
-
15
- /**
16
- * @var Aoe_Scheduler_Model_Schedule
17
- */
18
- protected $schedule;
19
-
20
-
21
-
22
- /**
23
- * Set schedule
24
- *
25
- * @param Aoe_Scheduler_Model_Schedule $schedule
26
- * @return Aoe_Scheduler_Block_Adminhtml_TimelineDetail
27
- */
28
- public function setSchedule(Aoe_Scheduler_Model_Schedule $schedule) {
29
- $this->schedule = $schedule;
30
- return $this;
31
- }
32
-
33
-
34
-
35
- /**
36
- * Get schedule
37
- *
38
- * @return Aoe_Scheduler_Block_Adminhtml_TimelineDetail
39
- */
40
- public function getSchedule() {
41
- return $this->schedule;
42
- }
43
-
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Helper/Data.php DELETED
@@ -1,109 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Helper
5
- *
6
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
7
- */
8
- class Aoe_Scheduler_Helper_Data extends Mage_Core_Helper_Abstract {
9
-
10
-
11
-
12
- /**
13
- * Explodes a string and trims all values for whitespace in the ends.
14
- * If $onlyNonEmptyValues is set, then all blank ('') values are removed.
15
- *
16
- * @see t3lib_div::trimExplode() in TYPO3
17
- * @param string Delimiter string to explode with
18
- * @param string The string to explode
19
- * @param boolean If set, all empty values will be removed in output
20
- * @return array Exploded values
21
- */
22
- public function trimExplode($delim, $string, $removeEmptyValues=false) {
23
- $explodedValues = explode($delim, $string);
24
-
25
- $result = array_map('trim', $explodedValues);
26
-
27
- if ($removeEmptyValues) {
28
- $temp = array();
29
- foreach ($result as $value) {
30
- if ($value !== '') {
31
- $temp[] = $value;
32
- }
33
- }
34
- $result = $temp;
35
- }
36
-
37
- return $result;
38
- }
39
-
40
-
41
-
42
- /**
43
- * Decorate status values
44
- *
45
- * @return string
46
- */
47
- public function decorateStatus($status) {
48
- switch ($status) {
49
- case Mage_Cron_Model_Schedule::STATUS_SUCCESS:
50
- $result = '<span class="bar-green"><span>'.$status.'</span></span>';
51
- break;
52
- case Mage_Cron_Model_Schedule::STATUS_PENDING:
53
- $result = '<span class="bar-lightgray"><span>'.$status.'</span></span>';
54
- break;
55
- case Mage_Cron_Model_Schedule::STATUS_RUNNING:
56
- $result = '<span class="bar-yellow"><span>'.$status.'</span></span>';
57
- break;
58
- case Mage_Cron_Model_Schedule::STATUS_MISSED:
59
- $result = '<span class="bar-orange"><span>'.$status.'</span></span>';
60
- break;
61
- case Mage_Cron_Model_Schedule::STATUS_ERROR:
62
- $result = '<span class="bar-red"><span>'.$status.'</span></span>';
63
- break;
64
- default:
65
- $result = $status;
66
- break;
67
- }
68
- return $result;
69
- }
70
-
71
-
72
-
73
- /**
74
- * Wrapepr for decorateTime to be used a frame_callback to avoid that additional parameters
75
- * conflict with the method's optional ones
76
- *
77
- * @param string $value
78
- * @return string
79
- */
80
- public function decorateTimeFrameCallBack($value) {
81
- return $this->decorateTime($value, false, NULL);
82
- }
83
-
84
-
85
-
86
- /**
87
- * Decorate time values
88
- *
89
- * @param string value
90
- * @param bool $echoToday if true "Today" will be added
91
- * @param string $dateFormat make sure Y-m-d is in it, if you want to have it replaced
92
- * @return string
93
- */
94
- public function decorateTime($value, $echoToday=false, $dateFormat=NULL) {
95
- if (empty($value) || $value == '0000-00-00 00:00:00') {
96
- $value = '';
97
- } else {
98
- $value = Mage::getModel('core/date')->date($dateFormat, $value);
99
- $replace = array(
100
- Mage::getModel('core/date')->date('Y-m-d ', time()) => $echoToday ? Mage::helper('aoe_scheduler')->__('Today') . ', ' : '', // today
101
- Mage::getModel('core/date')->date('Y-m-d ', strtotime('+1 day')) => Mage::helper('aoe_scheduler')->__('Tomorrow') . ', ',
102
- Mage::getModel('core/date')->date('Y-m-d ', strtotime('-1 day')) => Mage::helper('aoe_scheduler')->__('Yesterday') . ', ',
103
- );
104
- $value = str_replace(array_keys($replace), array_values($replace), $value);
105
- }
106
- return $value;
107
- }
108
-
109
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/Api.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- /**
3
- * Scheduler API
4
- *
5
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
6
- */
7
- class Aoe_Scheduler_Model_Api extends Mage_Api_Model_Resource_Abstract {
8
-
9
- /**
10
- * Run task
11
- *
12
- * @param $code
13
- * @return array
14
- */
15
- public function runNow($code) {
16
- $schedule = Mage::getModel('cron/schedule') /* @var $schedule Aoe_Scheduler_Model_Schedule */
17
- ->setJobCode($code)
18
- ->runNow(false) // without trying to lock the job
19
- ->save();
20
- return $schedule->getData();
21
- }
22
-
23
- /**
24
- * Schedule task
25
- *
26
- * @param $code
27
- * @param null $time
28
- * @return array
29
- */
30
- public function schedule($code, $time=NULL) {
31
- $schedule = Mage::getModel('cron/schedule') /* @var $schedule Aoe_Scheduler_Model_Schedule */
32
- ->setJobCode($code)
33
- ->schedule($time)
34
- ->save();
35
- return $schedule->getData();
36
- }
37
-
38
- /**
39
- * Get info
40
- *
41
- * @param $id
42
- * @return string
43
- */
44
- public function info($id) {
45
- $schedule = Mage::getModel('cron/schedule')->load($id); /* @var $schedule Aoe_Scheduler_Model_Schedule */
46
- return $schedule->getData();
47
- }
48
-
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/Collection/Crons.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Collection of available tasks (crons)
5
- *
6
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
7
- */
8
- class Aoe_Scheduler_Model_Collection_Crons extends Varien_Data_Collection {
9
-
10
- protected $_dataLoaded = false;
11
-
12
- /**
13
- * Load data
14
- *
15
- * @param bool $printQuery
16
- * @param bool $logQuery
17
- * @return Aoe_Scheduler_Model_Collection_Crons
18
- */
19
- public function loadData($printQuery = false, $logQuery = false) {
20
- if ($this->_dataLoaded) {
21
- return $this;
22
- }
23
-
24
- foreach ($this->getAllCodes() as $code) {
25
- $configuration = Mage::getModel('aoe_scheduler/configuration')->loadByCode($code);
26
- $this->addItem($configuration);
27
- }
28
-
29
- $this->_dataLoaded = true;
30
- return $this;
31
- }
32
-
33
-
34
-
35
- /**
36
- * Get all available codes
37
- *
38
- * @return array
39
- */
40
- protected function getAllCodes() {
41
- $codes = array();
42
- $config = Mage::getConfig()->getNode('crontab/jobs'); /* @var $config Mage_Core_Model_Config_Element */
43
- if ($config instanceof Mage_Core_Model_Config_Element) {
44
- foreach ($config->children() as $key => $tmp) {
45
- if (!in_array($key, $codes)) {
46
- $codes[] = $key;
47
- }
48
- }
49
- }
50
- $config = Mage::getConfig()->getNode('default/crontab/jobs'); /* @var $config Mage_Core_Model_Config_Element */
51
- if ($config instanceof Mage_Core_Model_Config_Element) {
52
- foreach ($config->children() as $key => $tmp) {
53
- if (!in_array($key, $codes)) {
54
- $codes[] = $key;
55
- }
56
- }
57
- }
58
- sort($codes);
59
- return $codes;
60
- }
61
-
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/Configuration.php DELETED
@@ -1,129 +0,0 @@
1
- <?php
2
-
3
- /**
4
- *
5
- * Enter description here ...
6
- *
7
- * @author Fabrizio
8
- *
9
- * @method string getModel()
10
- * @method string getStatus()
11
- * @method string getCronExpr()
12
- */
13
- class Aoe_Scheduler_Model_Configuration extends Mage_Core_Model_Abstract {
14
-
15
- const STATUS_DISABLED = 'disabled';
16
- const STATUS_ENABLED = 'enabled';
17
-
18
-
19
-
20
- /**
21
- * Override method.
22
- *
23
- * @return false
24
- */
25
- protected function _getResource() {
26
- return false;
27
- }
28
-
29
-
30
-
31
- /**
32
- * Get id field name
33
- *
34
- * @return string
35
- */
36
- public function getIdFieldName() {
37
- return 'id';
38
- }
39
-
40
-
41
-
42
- /**
43
- * Load configuration object by code
44
- *
45
- * @param string $code
46
- */
47
- public function loadByCode($code) {
48
- $this->setId($code);
49
- $this->setName($code);
50
-
51
- $global = $this->getGlobalCrontabJobXmlConfig();
52
- $cronExpr = null;
53
- if ($global && $global->schedule && $global->schedule->config_path) {
54
- $cronExpr = Mage::getStoreConfig((string)$global->schedule->config_path);
55
- }
56
- if (empty($cronExpr) && $global && $global->schedule && $global->schedule->cron_expr) {
57
- $cronExpr = (string)$global->schedule->cron_expr;
58
- }
59
- if ($cronExpr) {
60
- $this->setCronExpr($cronExpr);
61
- }
62
- if ($global && $global->run && $global->run->model) {
63
- $this->setModel((string)$global->run->model);
64
- }
65
-
66
- $configurable = $this->getConfigurableCrontabJobXmlConfig();
67
- if ($configurable) {
68
- if (is_object($configurable->schedule)) {
69
- if ($configurable && $configurable->schedule && $configurable->schedule->cron_expr) {
70
- $this->setCronExpr((string)$configurable->schedule->cron_expr);
71
- }
72
- }
73
- if (is_object($configurable->run)) {
74
- if ($configurable && $configurable->run && $configurable->run->model) {
75
- $this->setModel((string)$configurable->run->model);
76
- }
77
- }
78
- }
79
-
80
- if (!$this->getModel()) {
81
- Mage::throwException(sprintf('No configuration found for code "%s"', $code));
82
- }
83
-
84
- $disabledCrons = Mage::helper('aoe_scheduler')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
85
- $this->setStatus(in_array($this->getId(), $disabledCrons) ? self::STATUS_DISABLED : self::STATUS_ENABLED);
86
-
87
- return $this;
88
- }
89
-
90
-
91
-
92
- /**
93
- * Get global crontab job xml configuration
94
- *
95
- * @return Mage_Core_Model_Config_Element|false
96
- */
97
- protected function getGlobalCrontabJobXmlConfig() {
98
- return $this->getJobXmlConfig('crontab/jobs');
99
- }
100
-
101
-
102
-
103
- /**
104
- * Get configurable crontab job xml configuration
105
- *
106
- * @return Mage_Core_Model_Config_Element|false
107
- */
108
- protected function getConfigurableCrontabJobXmlConfig() {
109
- return $this->getJobXmlConfig('default/crontab/jobs');
110
- }
111
-
112
-
113
-
114
- /**
115
- * Get job xml configuration
116
- *
117
- * @param string $path path to configuration
118
- * @return Mage_Core_Model_Config_Element|false
119
- */
120
- protected function getJobXmlConfig($path) {
121
- $xmlConfig = false;
122
- $config = Mage::getConfig()->getNode($path);
123
- if ($config instanceof Mage_Core_Model_Config_Element) {
124
- $xmlConfig = $config->{$this->getId()};
125
- }
126
- return $xmlConfig;
127
- }
128
-
129
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/HeartbeatTask.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- class Aoe_Scheduler_Model_HeartbeatTask {
4
-
5
- public function run() {
6
- return true;
7
- }
8
-
9
- }
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/Observer.php DELETED
@@ -1,188 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Crontab observer.
5
- *
6
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
7
- */
8
- class Aoe_Scheduler_Model_Observer extends Mage_Cron_Model_Observer {
9
-
10
-
11
- const XML_PATH_MAX_RUNNING_TIME = 'system/cron/max_running_time';
12
-
13
- /**
14
- * Process cron queue
15
- * Generate tasks schedule
16
- * Cleanup tasks schedule
17
- *
18
- * @param Varien_Event_Observer $observer
19
- */
20
- public function dispatch($observer)
21
- {
22
- $schedules = $this->getPendingSchedules();
23
- $scheduleLifetime = Mage::getStoreConfig(self::XML_PATH_SCHEDULE_LIFETIME) * 60;
24
- $now = time();
25
- $jobsRoot = Mage::getConfig()->getNode('crontab/jobs');
26
-
27
- foreach ($schedules->getIterator() as $schedule) { /* @var $schedule Aoe_Scheduler_Model_Schedule */
28
- try {
29
- $errorStatus = Mage_Cron_Model_Schedule::STATUS_ERROR;
30
- $errorMessage = Mage::helper('cron')->__('Unknown error.');
31
-
32
- $jobConfig = $jobsRoot->{$schedule->getJobCode()};
33
- if (!$jobConfig || !$jobConfig->run) {
34
- Mage::throwException(Mage::helper('cron')->__('No valid configuration found.'));
35
- }
36
-
37
- $runConfig = $jobConfig->run;
38
- $time = strtotime($schedule->getScheduledAt());
39
- if ($time > $now) {
40
- continue;
41
- }
42
-
43
- if ($time < $now - $scheduleLifetime) {
44
- $errorStatus = Mage_Cron_Model_Schedule::STATUS_MISSED;
45
- Mage::throwException(Mage::helper('cron')->__('Too late for the schedule.'));
46
- }
47
-
48
- if ($runConfig->model) {
49
- if (!preg_match(self::REGEX_RUN_MODEL, (string)$runConfig->model, $run)) {
50
- Mage::throwException(Mage::helper('cron')->__('Invalid model/method definition, expecting "model/class::method".'));
51
- }
52
- if (!($model = Mage::getModel($run[1])) || !method_exists($model, $run[2])) {
53
- Mage::throwException(Mage::helper('cron')->__('Invalid callback: %s::%s does not exist', $run[1], $run[2]));
54
- }
55
- $callback = array($model, $run[2]);
56
- $arguments = array($schedule);
57
- }
58
- if (empty($callback)) {
59
- Mage::throwException(Mage::helper('cron')->__('No callbacks found'));
60
- }
61
-
62
- if (!$schedule->tryLockJob()) {
63
- // another cron started this job intermittently, so skip it
64
- continue;
65
- }
66
- /**
67
- though running status is set in tryLockJob we must set it here because the object
68
- was loaded with a pending status and will set it back to pending if we don't set it here
69
- */
70
- $schedule
71
- ->setStatus(Mage_Cron_Model_Schedule::STATUS_RUNNING)
72
- ->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', time()))
73
- ->save();
74
-
75
- $messages = call_user_func_array($callback, $arguments);
76
-
77
- // added by Fabrizio to also save messages when no exception was thrown
78
- if (!empty($messages)) {
79
- if (is_object($messages)) {
80
- $messages = get_class($messages);
81
- } elseif (!is_scalar($messages)) {
82
- $messages = var_export($messages, 1);
83
- }
84
- $schedule->setMessages($messages);
85
- }
86
-
87
- if (strtoupper(substr($messages, 0, 6)) != 'ERROR:') {
88
- $schedule->setStatus(Mage_Cron_Model_Schedule::STATUS_SUCCESS);
89
- } else {
90
- $schedule->setStatus(Mage_Cron_Model_Schedule::STATUS_ERROR);
91
- }
92
- $schedule->setFinishedAt(strftime('%Y-%m-%d %H:%M:%S', time()));
93
-
94
- } catch (Exception $e) {
95
- $schedule->setStatus($errorStatus)
96
- ->setMessages($e->__toString());
97
- }
98
- $schedule->save();
99
- }
100
-
101
- $this->generate();
102
- $this->checkRunningJobs();
103
- $this->cleanup();
104
- }
105
-
106
-
107
-
108
- /**
109
- * Check running jobs
110
- *
111
- * @return void
112
- */
113
- public function checkRunningJobs() {
114
-
115
- $maxAge = time() - Mage::getStoreConfig(self::XML_PATH_MAX_RUNNING_TIME) * 60;
116
-
117
- $schedules = Mage::getModel('cron/schedule')->getCollection()
118
- ->addFieldToFilter('status', Mage_Cron_Model_Schedule::STATUS_RUNNING)
119
- ->addFieldToFilter('executed_at', array('lt' => strftime('%Y-%m-%d %H:%M:00', $maxAge)))
120
- ->load();
121
-
122
- foreach ($schedules->getIterator() as $schedule) { /* @var $schedule Aoe_Scheduler_Model_Schedule */
123
- $schedule
124
- ->setStatus(Mage_Cron_Model_Schedule::STATUS_ERROR)
125
- ->setMessages('Job was running longer than the configured max_running_time')
126
- ->save();
127
- }
128
- }
129
-
130
-
131
-
132
- /**
133
- * Generate jobs for config information
134
- * Rewrites the original method to filter deactivated jobs
135
- *
136
- * @param $jobs
137
- * @param array $exists
138
- * @return Mage_Cron_Model_Observer
139
- */
140
- protected function _generateJobs($jobs, $exists) {
141
-
142
- $conf = Mage::getStoreConfig('system/cron/disabled_crons');
143
- $conf = explode(',', $conf);
144
- foreach ($conf as &$c) { $c = trim($c); }
145
-
146
- $newJobs = array();
147
- foreach ($jobs as $code => $config) {
148
- if (!in_array($code, $conf)) {
149
- $newJobs[$code] = $config;
150
- }
151
- }
152
-
153
- return parent::_generateJobs($newJobs, $exists);
154
- }
155
-
156
- /**
157
- * Generate cron schedule.
158
- * Rewrites the original method to remove duplicates afterwards (that exists because of a bug)
159
- *
160
- * @return Mage_Cron_Model_Observer
161
- */
162
- public function generate() {
163
- $result = parent::generate();
164
-
165
- $cron_schedule = Mage::getSingleton('core/resource')->getTableName('cron_schedule');
166
- $conn = Mage::getSingleton('core/resource')->getConnection('core_read');
167
- $results = $conn->fetchAll("
168
- SELECT
169
- GROUP_CONCAT(schedule_id) AS ids,
170
- CONCAT(job_code, scheduled_at) AS jobkey,
171
- count(*) AS qty
172
- FROM {$cron_schedule}
173
- WHERE status = 'pending'
174
- GROUP BY jobkey
175
- HAVING qty > 1;
176
- ");
177
- foreach($results as $row) {
178
- $ids = explode(',', $row['ids']);
179
- $removeIds = array_slice($ids, 1);
180
- foreach ($removeIds as $id) {
181
- Mage::getModel('cron/schedule')->load($id)->delete();
182
- }
183
- }
184
-
185
- return $result;
186
- }
187
-
188
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/Schedule.php DELETED
@@ -1,152 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @method string getExecutedAt()
5
- * @method string getFinishedAt()
6
- * @method string getStatus()
7
- * @method string getMessages()
8
- * @method string getCreatedAt()
9
- * @method string getScheduledAt()
10
- * @method string getJobCode()
11
- */
12
- class Aoe_Scheduler_Model_Schedule extends Mage_Cron_Model_Schedule {
13
-
14
- /**
15
- * @var Aoe_Scheduler_Model_Configuration
16
- */
17
- protected $_jobConfiguration;
18
-
19
-
20
- /**
21
- * Run this task now
22
- *
23
- * @param bool $tryLockJob
24
- * @return Aoe_Scheduler_Model_Schedule
25
- */
26
- public function runNow($tryLockJob=true) {
27
- $modelCallback = $this->getJobConfiguration()->getModel();
28
-
29
- if (!$this->getCreatedAt()) {
30
- $this->schedule();
31
- }
32
-
33
- if (!preg_match(Mage_Cron_Model_Observer::REGEX_RUN_MODEL, $modelCallback, $run)) {
34
- Mage::throwException(Mage::helper('cron')->__('Invalid model/method definition, expecting "model/class::method".'));
35
- }
36
- if (!($model = Mage::getModel($run[1])) || !method_exists($model, $run[2])) {
37
- Mage::throwException(Mage::helper('cron')->__('Invalid callback: %s::%s does not exist', $run[1], $run[2]));
38
- }
39
- $callback = array($model, $run[2]);
40
-
41
- if (empty($callback)) {
42
- Mage::throwException(Mage::helper('cron')->__('No callbacks found'));
43
- }
44
-
45
- // lock job requires the record to be saved and having status Mage_Cron_Model_Schedule::STATUS_PENDING
46
- // workaround could be to do this: $this->setStatus(Mage_Cron_Model_Schedule::STATUS_PENDING)->save();
47
- if ($tryLockJob && !$this->tryLockJob()) {
48
- // another cron started this job intermittently, so skip it
49
- return $this;
50
- }
51
- $this->setExecutedAt(strftime('%Y-%m-%d %H:%M:%S', time()));
52
-
53
- $messages = call_user_func_array($callback, array($this));
54
-
55
- // added by Fabrizio to also save messages when no exception was thrown
56
- if (!empty($messages)) {
57
- if (is_object($messages)) {
58
- $messages = get_class($messages);
59
- } elseif (!is_scalar($messages)) {
60
- $messages = var_export($messages, 1);
61
- }
62
- $this->setMessages($messages);
63
- }
64
-
65
- if (strtoupper(substr($messages, 0, 6)) != 'ERROR:') {
66
- $this->setStatus(Mage_Cron_Model_Schedule::STATUS_SUCCESS);
67
- } else {
68
- $this->setStatus(Mage_Cron_Model_Schedule::STATUS_ERROR);
69
- }
70
-
71
- $this->setFinishedAt(strftime('%Y-%m-%d %H:%M:%S', time()));
72
-
73
- return $this;
74
- }
75
-
76
-
77
-
78
- /**
79
- * Schedule this task to be executed as soon as possible
80
- *
81
- * @deprecated use Aoe_Scheduler_Model_Schedule::schedule() instead
82
- * @return Aoe_Scheduler_Model_Schedule
83
- */
84
- public function scheduleNow() {
85
- return $this->schedule();
86
- }
87
-
88
-
89
-
90
- /**
91
- * Schedule this task to be executed at a given time
92
- *
93
- * @param int $time
94
- * @return Aoe_Scheduler_Model_Schedule
95
- */
96
- public function schedule($time=NULL) {
97
- if (is_null($time)) {
98
- $time = time();
99
- }
100
- $this->setStatus(Mage_Cron_Model_Schedule::STATUS_PENDING)
101
- ->setCreatedAt(strftime('%Y-%m-%d %H:%M:%S', time()))
102
- ->setScheduledAt(strftime('%Y-%m-%d %H:%M:%S', $time));
103
- return $this;
104
- }
105
-
106
-
107
-
108
- /**
109
- * Get job configuration
110
- *
111
- * @return Aoe_Scheduler_Model_Configuration
112
- */
113
- public function getJobConfiguration() {
114
- if (is_null($this->_jobConfiguration)) {
115
- $this->_jobConfiguration = Mage::getModel('aoe_scheduler/configuration')->loadByCode($this->getJobCode());
116
- }
117
- return $this->_jobConfiguration;
118
- }
119
-
120
-
121
-
122
- /**
123
- * Get start time (planned or actual)
124
- *
125
- * @return string
126
- */
127
- public function getStarttime() {
128
- $starttime = $this->getExecutedAt();
129
- if (empty($starttime) || $starttime == '0000-00-00 00:00:00') {
130
- $starttime = $this->getScheduledAt();
131
- }
132
- return $starttime;
133
- }
134
-
135
-
136
-
137
- /**
138
- * Get job duration
139
- *
140
- * @return bool|int time in seconds, or false
141
- */
142
- public function getDuration() {
143
- $duration = false;
144
- if ($this->getExecutedAt() && ($this->getExecutedAt() != '0000-00-00 00:00:00')
145
- && $this->getFinishedAt() && ($this->getFinishedAt() != '0000-00-00 00:00:00')) {
146
- $duration = strtotime($this->getFinishedAt()) - strtotime($this->getExecutedAt());
147
- }
148
- return $duration;
149
- }
150
-
151
-
152
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/Model/TestTask.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- class Aoe_Scheduler_Model_TestTask {
4
-
5
- public function run() {
6
- sleep(rand(60,180));
7
- if (rand(0, 1) == 0) {
8
- throw new Exception('This is a dummy exception');
9
- }
10
- }
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/controllers/Adminhtml/AbstractController.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Abstract controller
5
- *
6
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
7
- */
8
- abstract class Aoe_Scheduler_Adminhtml_AbstractController extends Mage_Adminhtml_Controller_Action {
9
-
10
- /**
11
- * Index action (display grid)
12
- *
13
- * @return void
14
- */
15
- public function indexAction() {
16
- $this->loadLayout();
17
- $this->_setActiveMenu('system');
18
- $this->renderLayout();
19
- }
20
-
21
-
22
-
23
- /**
24
- * Generate schedule now
25
- *
26
- * @return void
27
- */
28
- public function generateScheduleAction() {
29
- $observer = Mage::getModel('cron/observer'); /* @var $observer Mage_Cron_Model_Observer */
30
- $observer->generate();
31
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Generated schedule'));
32
- $this->_redirect('*/*/index');
33
- }
34
-
35
- }
36
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/controllers/Adminhtml/CronController.php DELETED
@@ -1,112 +0,0 @@
1
- <?php
2
-
3
- require_once Mage::getModuleDir('controllers', 'Aoe_Scheduler').'/Adminhtml/AbstractController.php';
4
-
5
- /**
6
- * Cron controller
7
- *
8
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
9
- */
10
- class Aoe_Scheduler_Adminhtml_CronController extends Aoe_Scheduler_Adminhtml_AbstractController {
11
-
12
-
13
-
14
- /**
15
- * Mass action: disable
16
- *
17
- * @return void
18
- */
19
- public function disableAction() {
20
- $codes = $this->getRequest()->getParam('codes');
21
- $disabledCrons = Mage::helper('aoe_scheduler')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
22
- foreach ($codes as $code) {
23
- if (!in_array($code, $disabledCrons)) {
24
- $disabledCrons[] = $code;
25
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Disabled "%s"', $code));
26
- }
27
- }
28
- Mage::getModel('core/config')->saveConfig('system/cron/disabled_crons/', implode(',', $disabledCrons));
29
- Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(Mage_Core_Model_Config::CACHE_TAG));
30
- $this->_redirect('*/*/index');
31
- }
32
-
33
-
34
-
35
- /**
36
- * Mass action: enable
37
- *
38
- * @return void
39
- */
40
- public function enableAction() {
41
- $codes = $this->getRequest()->getParam('codes');
42
- $disabledCrons = Mage::helper('aoe_scheduler')->trimExplode(',', Mage::getStoreConfig('system/cron/disabled_crons'), true);
43
- foreach ($codes as $key => $code) {
44
- if (in_array($code, $disabledCrons)) {
45
- unset($disabledCrons[array_search($code, $disabledCrons)]);
46
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Enabled "%s"', $code));
47
- }
48
- }
49
- Mage::getModel('core/config')->saveConfig('system/cron/disabled_crons/', implode(',', $disabledCrons));
50
- Mage::app()->getCache()->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(Mage_Core_Model_Config::CACHE_TAG));
51
- $this->_redirect('*/*/index');
52
- }
53
-
54
-
55
-
56
-
57
- /**
58
- * Mass action: schedule now
59
- *
60
- * @return void
61
- */
62
- public function scheduleNowAction() {
63
- $codes = $this->getRequest()->getParam('codes');
64
- if (is_array($codes)) {
65
- foreach ($codes as $key) {
66
- Mage::getModel('cron/schedule') /* @var Aoe_Scheduler_Model_Schedule */
67
- ->setJobCode($key)
68
- ->schedule()
69
- ->save();
70
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Scheduled "%s"', $key));
71
- }
72
- }
73
- $this->_redirect('*/*/index');
74
- }
75
-
76
-
77
-
78
- /**
79
- * Mass action: run now
80
- *
81
- * @return void
82
- */
83
- public function runNowAction() {
84
- $codes = $this->getRequest()->getParam('codes');
85
- if (is_array($codes)) {
86
- foreach ($codes as $key) {
87
- $schedule = Mage::getModel('cron/schedule') /* @var $schedule Aoe_Scheduler_Model_Schedule */
88
- ->setJobCode($key)
89
- ->runNow(false) // without trying to lock the job
90
- ->save();
91
-
92
- $messages = $schedule->getMessages();
93
-
94
- if ($schedule->getStatus() == Mage_Cron_Model_Schedule::STATUS_SUCCESS) {
95
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Ran "%s" (Duration: %s sec)', $key, intval($schedule->getDuration())));
96
- if ($messages) {
97
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('"%s" messages:<pre>%s</pre>', $key, $messages));
98
- }
99
- } else {
100
- Mage::getSingleton('adminhtml/session')->addError($this->__('Error while running "%s"', $key));
101
- if ($messages) {
102
- Mage::getSingleton('adminhtml/session')->addError($this->__('"%s" messages:<pre>%s</pre>', $key, $messages));
103
- }
104
- }
105
-
106
- }
107
- }
108
- $this->_redirect('*/*/index');
109
- }
110
-
111
- }
112
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/controllers/Adminhtml/SchedulerController.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
-
3
- require_once Mage::getModuleDir('controllers', 'Aoe_Scheduler').'/Adminhtml/AbstractController.php';
4
-
5
- /**
6
- * Scheduler controller
7
- *
8
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
9
- */
10
- class Aoe_Scheduler_Adminhtml_SchedulerController extends Aoe_Scheduler_Adminhtml_AbstractController {
11
-
12
-
13
-
14
- /**
15
- * Mass action: delete
16
- *
17
- * @return void
18
- */
19
- public function deleteAction() {
20
- $ids = $this->getRequest()->getParam('schedule_ids');
21
- foreach ($ids as $id) {
22
- $schedule = Mage::getModel('cron/schedule')->load($id)->delete(); /* @var $schedule Mage_Cron_Model_Schedule */
23
- }
24
- Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Deleted task(s) "%s"', implode(', ', $ids)));
25
- $this->_redirect('*/*/index');
26
- }
27
-
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/controllers/Adminhtml/TimelineController.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- require_once Mage::getModuleDir('controllers', 'Aoe_Scheduler').'/Adminhtml/AbstractController.php';
4
-
5
- /**
6
- * Timeline controller
7
- *
8
- * @author Fabrizio Branca <fabrizio.branca@aoemedia.de>
9
- */
10
- class Aoe_Scheduler_Adminhtml_TimelineController extends Aoe_Scheduler_Adminhtml_AbstractController {
11
-
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/etc/adminhtml.xml DELETED
@@ -1,61 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <menu>
4
- <system>
5
- <children>
6
- <aoe_scheduler translate="title">
7
- <title>Scheduler</title>
8
- <sort_order>1</sort_order>
9
- <children>
10
- <aoe_scheduler_cron translate="title">
11
- <title>Schedule Configuration</title>
12
- <sort_order>10</sort_order>
13
- <action>adminhtml/cron/index</action>
14
- </aoe_scheduler_cron>
15
- <aoe_scheduler_scheduler translate="title">
16
- <title>List View</title>
17
- <sort_order>20</sort_order>
18
- <action>adminhtml/scheduler/index</action>
19
- </aoe_scheduler_scheduler>
20
- <aoe_scheduler_timeline translate="title">
21
- <title>Timeline View</title>
22
- <sort_order>30</sort_order>
23
- <action>adminhtml/timeline/index</action>
24
- </aoe_scheduler_timeline>
25
- </children>
26
- </aoe_scheduler>
27
- </children>
28
- </system>
29
- </menu>
30
-
31
- <acl>
32
- <resources>
33
- <admin>
34
- <children>
35
- <system>
36
- <children>
37
- <aoe_scheduler translate="title" module="aoe_scheduler">
38
- <title>AOE Scheduler</title>
39
- <sort_order>1</sort_order>
40
- <children>
41
- <aoe_scheduler_cron translate="title">
42
- <title>Schedule Configuration</title>
43
- <sort_order>10</sort_order>
44
- </aoe_scheduler_cron>
45
- <aoe_scheduler_scheduler translate="title">
46
- <title>List View</title>
47
- <sort_order>20</sort_order>
48
- </aoe_scheduler_scheduler>
49
- <aoe_scheduler_timeline translate="title">
50
- <title>Timeline View</title>
51
- <sort_order>30</sort_order>
52
- </aoe_scheduler_timeline>
53
- </children>
54
- </aoe_scheduler>
55
- </children>
56
- </system>
57
- </children>
58
- </admin>
59
- </resources>
60
- </acl>
61
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/etc/api.xml DELETED
@@ -1,42 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <api>
4
- <resources>
5
- <aoe_scheduler translate="title" module="aoe_scheduler">
6
- <model>aoe_scheduler/api</model>
7
- <title>Scheduler API</title>
8
- <acl>aoe_scheduler/aoe_scheduler</acl>
9
- <methods>
10
- <runNow translate="title" module="aoe_scheduler">
11
- <title>Run scheduler task</title>
12
- <acl>aoe_scheduler/aoe_scheduler/runNow</acl>
13
- </runNow>
14
- <schedule translate="title" module="aoe_scheduler">
15
- <title>Schedule task</title>
16
- <acl>aoe_scheduler/aoe_scheduler/schedule</acl>
17
- </schedule>
18
- <info translate="title" module="aoe_scheduler">
19
- <title>Get task information</title>
20
- <acl>aoe_scheduler/aoe_scheduler/info</acl>
21
- </info>
22
- </methods>
23
- </aoe_scheduler>
24
- </resources>
25
- <acl>
26
- <resources>
27
- <aoe_scheduler translate="title" module="aoe_scheduler">
28
- <title>AOE Scheduler</title>
29
- <runNow translate="title" module="aoe_scheduler">
30
- <title>Run scheduler task</title>
31
- </runNow>
32
- <schedule translate="title" module="aoe_scheduler">
33
- <title>Schedule task</title>
34
- </schedule>
35
- <info translate="title" module="aoe_scheduler">
36
- <title>Get task information</title>
37
- </info>
38
- </aoe_scheduler>
39
- </resources>
40
- </acl>
41
- </api>
42
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/etc/config.xml DELETED
@@ -1,90 +0,0 @@
1
- <?xml version="1.0" ?>
2
- <config>
3
- <modules>
4
- <Aoe_Scheduler>
5
- <version>0.2.2</version>
6
- </Aoe_Scheduler>
7
- </modules>
8
-
9
- <global>
10
- <blocks>
11
- <aoe_scheduler>
12
- <class>Aoe_Scheduler_Block</class>
13
- </aoe_scheduler>
14
- </blocks>
15
-
16
- <helpers>
17
- <aoe_scheduler>
18
- <class>Aoe_Scheduler_Helper</class>
19
- </aoe_scheduler>
20
- </helpers>
21
-
22
- <models>
23
- <aoe_scheduler>
24
- <class>Aoe_Scheduler_Model</class>
25
- </aoe_scheduler>
26
-
27
- <cron>
28
- <rewrite>
29
- <observer>Aoe_Scheduler_Model_Observer</observer>
30
- <schedule>Aoe_Scheduler_Model_Schedule</schedule>
31
- </rewrite>
32
- </cron>
33
- </models>
34
- </global>
35
-
36
- <admin>
37
- <routers>
38
- <adminhtml>
39
- <args>
40
- <modules>
41
- <Aoe_Scheduler before="Mage_Adminhtml">Aoe_Scheduler_Adminhtml</Aoe_Scheduler>
42
- </modules>
43
- </args>
44
- </adminhtml>
45
- </routers>
46
- </admin>
47
-
48
- <adminhtml>
49
- <translate>
50
- <modules>
51
- <aoe_scheduler>
52
- <files>
53
- <default>Aoe_Scheduler.csv</default>
54
- </files>
55
- </aoe_scheduler>
56
- </modules>
57
- </translate>
58
- <layout>
59
- <updates>
60
- <aoe_scheduler>
61
- <file>aoe_scheduler/aoe_scheduler.xml</file>
62
- </aoe_scheduler>
63
- </updates>
64
- </layout>
65
- </adminhtml>
66
-
67
- <crontab>
68
- <jobs>
69
- <!-- <aoescheduler_testtask>
70
- <schedule><cron_expr>*/5 * * * *</cron_expr></schedule>
71
- <run><model>aoe_scheduler/testTask::run</model></run>
72
- </aoescheduler_testtask> -->
73
-
74
- <aoescheduler_heartbeat>
75
- <schedule><config_path>system/cron/scheduler_cron_expr_heartbeat</config_path></schedule>
76
- <run><model>aoe_scheduler/heartbeatTask::run</model></run>
77
- </aoescheduler_heartbeat>
78
- </jobs>
79
- </crontab>
80
-
81
- <default>
82
- <system>
83
- <cron>
84
- <max_running_time>120</max_running_time>
85
- <scheduler_cron_expr_heartbeat>*/5 * * * *</scheduler_cron_expr_heartbeat>
86
- </cron>
87
- </system>
88
- </default>
89
-
90
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/local/Aoe/Scheduler/etc/system.xml DELETED
@@ -1,38 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <sections>
4
- <system>
5
- <groups>
6
- <cron translate="label comment" module="cron">
7
- <fields>
8
- <disabled_crons translate="label">
9
- <label>Disabled cron tasks</label>
10
- <frontend_type>text</frontend_type>
11
- <sort_order>100</sort_order>
12
- <show_in_default>1</show_in_default>
13
- <show_in_website>0</show_in_website>
14
- <show_in_store>0</show_in_store>
15
- </disabled_crons>
16
- <max_running_time translate="label">
17
- <label>Mark jobs as failed after</label>
18
- <comment><![CDATA[Maximum time in minutes. The will only marked as failed. It won't be killed (if it should actually be still running).]]></comment>
19
- <frontend_type>text</frontend_type>
20
- <sort_order>100</sort_order>
21
- <show_in_default>1</show_in_default>
22
- <show_in_website>0</show_in_website>
23
- <show_in_store>0</show_in_store>
24
- </max_running_time>
25
- <scheduler_cron_expr_heartbeat>
26
- <label>Heartbeat task schedule (cron syntax)</label>
27
- <frontend_type>text</frontend_type>
28
- <sort_order>110</sort_order>
29
- <show_in_default>1</show_in_default>
30
- <show_in_website>0</show_in_website>
31
- <show_in_store>0</show_in_store>
32
- </scheduler_cron_expr_heartbeat>
33
- </fields>
34
- </cron>
35
- </groups>
36
- </system>
37
- </sections>
38
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Aoe_Scheduler.xml CHANGED
@@ -3,7 +3,7 @@
3
  <modules>
4
  <Aoe_Scheduler>
5
  <active>true</active>
6
- <codePool>local</codePool>
7
  </Aoe_Scheduler>
8
  </modules>
9
- </config>
3
  <modules>
4
  <Aoe_Scheduler>
5
  <active>true</active>
6
+ <codePool>community</codePool>
7
  </Aoe_Scheduler>
8
  </modules>
9
+ </config>
package.xml CHANGED
@@ -1,21 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Aoe_Scheduler</name>
4
- <version>0.2.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Scheduler / Cron Management</summary>
10
  <description>This extension allows you to manage your scheduler task. Schedules can be disabled. From version 0.1.0 this extension also comes with a graphical timeline view.</description>
11
- <notes>Added heartbeat.&#xD;
12
- Fixed acl bug.&#xD;
13
- &#xD;
14
- Check http://www.fabrizio-branca.de/magento-cron-scheduler.html for a summary of new features and bugfixes</notes>
15
- <authors><author><name>Fabrizio Branca</name><user>auto-converted</user><email>magento@fabrizio-branca.de</email></author></authors>
16
- <date>2012-01-30</date>
17
- <time>21:42:26</time>
18
- <contents><target name="magelocal"><dir name="Aoe"><dir name="Scheduler"><dir name="Block"><dir name="Adminhtml"><dir name="Cron"><file name="Grid.php" hash="794200ea4a6885a19b86c972d06b3693"/></dir><dir name="Scheduler"><file name="Grid.php" hash="73eb69714d3ec1a6b3e5ceb566067ad1"/></dir><file name="Cron.php" hash="f3fe20d102c7ddff6c1a4f72c14ab95f"/><file name="Scheduler.php" hash="a9d0f50f2a66532f76746cc311ad1b09"/><file name="Timeline.php" hash="4febff14b58b081b3df00871a3ce0d8e"/><file name="TimelineDetail.php" hash="0cdc46705c070dee76c6938175586c6a"/></dir></dir><dir name="Helper"><file name="Data.php" hash="9ba5f7c21da1a226e531162b9e9622d2"/></dir><dir name="Model"><dir name="Collection"><file name="Crons.php" hash="9ec07bc98bf6ce69ba830490d224ea81"/></dir><file name="Api.php" hash="2f674c989ec27b19f2f5530fcf698c0c"/><file name="Configuration.php" hash="1c21f0c4fa50cd4980fe1bdb7e4956f3"/><file name="HeartbeatTask.php" hash="0c8e9cb7c28cb412b20062ee1d6647b5"/><file name="Observer.php" hash="e16ed30761103862660a771915d6577f"/><file name="Schedule.php" hash="6a9b0c469ccf667e1a8011e25492f2d0"/><file name="TestTask.php" hash="96ac1c00c24cf959cbef452dd57900e4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AbstractController.php" hash="4435f29815e4253eb47f15221b5c0d43"/><file name="CronController.php" hash="fdb5947cb2a45ba4e616cb78127a217a"/><file name="SchedulerController.php" hash="95ffe62214e872e566332de6a2141cab"/><file name="TimelineController.php" hash="c0ccb4163c8495c9b8b07a869e27563b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="40a0190b9c9e79f69c05fb6308b1310e"/><file name="api.xml" hash="cc6cc05874a1277ba53e07c3450541c5"/><file name="config.xml" hash="5fe36afc8a5d9112c06aa7c462d64d73"/><file name="system.xml" hash="0aa6a79823460c3aeb5a955f5123f3c0"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aoe_Scheduler.xml" hash="3fa179507d5b3b3f1cde3be281ee1a26"/></dir></target><target name="mage"><dir name="shell"><file name="scheduler.php" hash="126f850a96a163db7fa8e82c16998507"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="Aoe_Scheduler.csv" hash="f06c379c1170bc67f978b05943197601"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="aoe_scheduler"><file name="timeline.phtml" hash="9b8bf5864319542e8aa6ecc19efa5108"/><file name="timeline_detail.phtml" hash="d353689ad539f2adc0df97716ff7eb88"/></dir></dir><dir name="layout"><dir name="aoe_scheduler"><file name="aoe_scheduler.xml" hash="95be2d020b3281f3400a2edb809fce79"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="aoe_scheduler"><dir name="Images"><file name="bg_notifications.gif" hash="df73b8aa7e48bb56e0a644245aa3683f"/><file name="gradient.png" hash="17f6c6ef64b1682a06060950933561c9"/><file name="hour.gif" hash="91a63b82b2b41a046ca938aea3238a41"/></dir><dir name="JavaScript"><file name="common.js" hash="af6dadb7e3a18a2d4a882d9249f3f7a0"/><file name="jquery-1.6.2.min.js" hash="a1a8cb16a060f6280a767187fd22e037"/><file name="tooltip.dynamic.js" hash="c6737dd54890ca0cac816f3fecaf33d9"/><file name="tooltip.js" hash="d731eecbe152f86d3c702b55b4767fb1"/></dir><dir name="StyleSheet"><file name="bars.css" hash="c98df4a3611f628dba01b8cd0142f3d2"/><file name="timeline.css" hash="41510bd533aaeab5df46fa49210cfc9f"/></dir></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
- <dependencies/>
21
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Aoe_Scheduler</name>
4
+ <version>0.3.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Scheduler / Cron Management</summary>
10
  <description>This extension allows you to manage your scheduler task. Schedules can be disabled. From version 0.1.0 this extension also comes with a graphical timeline view.</description>
11
+ <notes>GIT Revision: 5831049ed3c4f99a32351649ed5599c15d3a5192, Build Date: 2013-02-28 22:29:19</notes>
12
+ <authors><author><name>Fabrizio Branca</name><user>fbrnc</user><email>magento@fabrizio-branca.de</email></author></authors>
13
+ <date>2013-02-28</date>
14
+ <time>22:29:19</time>
15
+ <contents><target name="mageetc"><dir><dir name="modules"><file name="Aoe_Scheduler.xml" hash="d347eefeddc87aea31e3243f6108fa70"/></dir></dir></target><target name="mage"><dir><dir name="shell"><file name="scheduler.php" hash="126f850a96a163db7fa8e82c16998507"/></dir></dir></target><target name="magelocale"><dir><dir name="de_DE"><file name="Aoe_Scheduler.csv" hash="f06c379c1170bc67f978b05943197601"/></dir></dir></target><target name="magedesign"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="aoe_scheduler"><file name="timeline.phtml" hash="9b8bf5864319542e8aa6ecc19efa5108"/><file name="timeline_detail.phtml" hash="d353689ad539f2adc0df97716ff7eb88"/></dir></dir><dir name="layout"><dir name="aoe_scheduler"><file name="aoe_scheduler.xml" hash="95be2d020b3281f3400a2edb809fce79"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="aoe_scheduler"><dir><dir name="Images"><file name="bg_notifications.gif" hash="df73b8aa7e48bb56e0a644245aa3683f"/><file name="gradient.png" hash="17f6c6ef64b1682a06060950933561c9"/><file name="hour.gif" hash="91a63b82b2b41a046ca938aea3238a41"/></dir><dir name="JavaScript"><file name="common.js" hash="af6dadb7e3a18a2d4a882d9249f3f7a0"/><file name="jquery-1.6.2.min.js" hash="a1a8cb16a060f6280a767187fd22e037"/><file name="tooltip.dynamic.js" hash="c6737dd54890ca0cac816f3fecaf33d9"/><file name="tooltip.js" hash="d731eecbe152f86d3c702b55b4767fb1"/></dir><dir name="StyleSheet"><file name="bars.css" hash="c98df4a3611f628dba01b8cd0142f3d2"/><file name="timeline.css" hash="41510bd533aaeab5df46fa49210cfc9f"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
 
 
 
16
  <compatible/>
17
+ <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>