Skip to content

Commit 449ba59

Browse files
committed
Added MIT License.
1 parent 2e1df6e commit 449ba59

File tree

8 files changed

+79
-43
lines changed

8 files changed

+79
-43
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2009 [email protected]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

config/sql/queue.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
* @package QueuePlugin
66
* @subpackage QueuePlugin.Models
7+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
8+
* @link http://github.com/MSeven/cakephp_queue
79
*/
810
class queueSchema extends CakeSchema {
911
var $name = 'queue';

models/queued_task.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
* @package QueuePlugin
66
* @subpackage QueuePlugin.Models
7+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
8+
* @link http://github.com/MSeven/cakephp_queue
79
*/
810
class QueuedTask extends AppModel {
911

tests/cases/models/queued_task.test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
44
* @package QueuePlugin
55
* @subpackage QueuePlugin.Tests.Models
6+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
7+
* @link http://github.com/MSeven/cakephp_queue
68
*/
79

810
App::import('Model', 'Queue.QueuedTask');

tests/fixtures/queued_task_fixture.php

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,54 @@
44
55
* @package QueuePlugin
66
* @subpackage QueuePlugin.Tests.Fixtures
7+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
8+
* @link http://github.com/MSeven/cakephp_queue
79
*/
810

911
class QueuedTaskFixture extends CakeTestFixture {
1012
public $name = 'QueuedTask';
1113
public $table = 'queued_tasks';
1214
public $fields = array(
1315
'id' => array(
14-
'type' => 'integer',
15-
'null' => false,
16-
'default' => NULL,
17-
'length' => 10,
16+
'type' => 'integer',
17+
'null' => false,
18+
'default' => NULL,
19+
'length' => 10,
1820
'key' => 'primary'
19-
),
21+
),
2022
'jobtype' => array(
21-
'type' => 'string',
22-
'null' => false,
23+
'type' => 'string',
24+
'null' => false,
2325
'length' => 45
24-
),
26+
),
2527
'data' => array(
26-
'type' => 'text',
27-
'null' => true,
28+
'type' => 'text',
29+
'null' => true,
2830
'default' => NULL
29-
),
31+
),
3032
'created' => array(
31-
'type' => 'datetime',
33+
'type' => 'datetime',
3234
'null' => false
33-
),
35+
),
3436
'fetched' => array(
35-
'type' => 'datetime',
36-
'null' => true,
37+
'type' => 'datetime',
38+
'null' => true,
3739
'default' => NULL
38-
),
40+
),
3941
'completed' => array(
40-
'type' => 'datetime',
41-
'null' => true,
42+
'type' => 'datetime',
43+
'null' => true,
4244
'default' => NULL
43-
),
45+
),
4446
'failed' => array(
45-
'type' => 'integer',
46-
'null' => false,
47-
'default' => '0',
47+
'type' => 'integer',
48+
'null' => false,
49+
'default' => '0',
4850
'length' => 3
49-
),
51+
),
5052
'indexes' => array(
5153
'PRIMARY' => array(
52-
'column' => 'id',
54+
'column' => 'id',
5355
'unique' => 1
5456
)
5557
)

vendors/shells/queue.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
* @package QueuePlugin
66
* @subpackage QueuePlugin.Shells
7+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
8+
* @link http://github.com/MSeven/cakephp_queue
79
*/
810
class queueShell extends Shell {
911
public $uses = array(
@@ -22,7 +24,7 @@ class queueShell extends Shell {
2224
public function initialize() {
2325
App::import('Folder');
2426
$this->_loadModels();
25-
27+
2628
foreach ($this->Dispatch->shellPaths as $path) {
2729
$folder = new Folder($path . DS . 'tasks');
2830
$this->tasks = array_merge($this->tasks, $folder->find('queue_.*\.php'));
@@ -33,11 +35,12 @@ public function initialize() {
3335
}
3436
// default configuration vars.
3537
Configure::write('queue', array(
36-
'sleeptime' => 10,
38+
'sleeptime' => 10,
3739
'gcprop' => 10
3840
));
3941
//Config can be overwritten via local app config.
4042
Configure::load('queue');
43+
debug('hello');
4144
}
4245

4346
/**
@@ -75,7 +78,7 @@ public function add() {
7578
$this->out('Please call like this:');
7679
$this->out(' cake queue add <taskname>');
7780
} else {
78-
81+
7982
if (in_array($this->args[0], $this->taskNames)) {
8083
$this->{$this->args[0]}->add();
8184
} elseif (in_array('queue_' . $this->args[0], $this->taskNames)) {
@@ -92,7 +95,7 @@ public function add() {
9295

9396
/**
9497
* Run a QueueWorker loop.
95-
* Runs a Queue Worker process which will try to find unassigned jobs in the queue
98+
* Runs a Queue Worker process which will try to find unassigned jobs in the queue
9699
* which it may run and try to fetch and execute them.
97100
*/
98101
public function runworker() {
@@ -114,7 +117,7 @@ public function runworker() {
114117
$this->out('nothing to do, sleeping.');
115118
sleep(Configure::read('queue.sleeptime'));
116119
}
117-
120+
118121
if (rand(0, 100) > (100 - Configure::read('queue.gcprop'))) {
119122
$this->out('Performing Old job cleanup.');
120123
$this->QueuedTask->cleanOldJobs();

vendors/shells/tasks/queue_email.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
* @package QueuePlugin
66
* @subpackage QueuePlugin.Tasks
7+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
8+
* @link http://github.com/MSeven/cakephp_queue
79
* @see http://bakery.cakephp.org/articles/view/emailcomponent-in-a-cake-shell
810
*/
911
App::import('Core', 'Controller');
@@ -16,14 +18,14 @@ class queueEmailTask extends Shell {
1618
* @var array
1719
*/
1820
public $defaults = array(
19-
'to' => null,
20-
'subject' => null,
21-
'charset' => 'UTF-8',
22-
'from' => null,
23-
'sendAs' => 'html',
24-
'template' => null,
25-
'debug' => false,
26-
'additionalParams' => '',
21+
'to' => null,
22+
'subject' => null,
23+
'charset' => 'UTF-8',
24+
'from' => null,
25+
'sendAs' => 'html',
26+
'template' => null,
27+
'debug' => false,
28+
'additionalParams' => '',
2729
'layout' => 'default'
2830
);
2931
/**
@@ -32,7 +34,7 @@ class queueEmailTask extends Shell {
3234
* @var Controller
3335
*/
3436
public $Controller;
35-
37+
3638
/**
3739
* EmailComponent
3840
*
@@ -46,11 +48,11 @@ public function add() {
4648
$this->out('The Data Array should look something like this:');
4749
$this->out(var_export(array(
4850
'settings' => array(
49-
'to' => '[email protected]',
50-
'subject' => 'Email Subject',
51-
'from' => '[email protected]',
51+
'to' => '[email protected]',
52+
'subject' => 'Email Subject',
53+
'from' => '[email protected]',
5254
'template' => 'sometemplate'
53-
),
55+
),
5456
'vars' => array(
5557
'text' => 'hello world'
5658
)

vendors/shells/tasks/queue_example.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
55
* @package QueuePlugin
66
* @subpackage QueuePlugin.Tasks
7+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
8+
* @link http://github.com/MSeven/cakephp_queue
79
*/
810

911
/**
@@ -19,7 +21,7 @@ class queueExampleTask extends Shell {
1921
public $uses = array(
2022
'Queue.QueuedTask'
2123
);
22-
24+
2325
/**
2426
* ZendStudio Codecomplete Hint
2527
*

0 commit comments

Comments
 (0)