This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/bin/php /path/to/your/ci/root/folder/index.php jobs listen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($receivers as $receiver) | |
{ | |
$this->model->create('jobs', [ | |
'name' => 'sendEmail', | |
'payload' => json_encode([ | |
'subject' => 'My beautiful subject', | |
'type' => 'html', | |
'message' => 'This is an email!', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `jobs` ( | |
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, | |
`name` VARCHAR(45) NOT NULL, | |
`payload` TEXT NULL COMMENT 'JSON payload', | |
`response` TEXT NULL, | |
`status` ENUM('running', 'queued', 'done') NOT NULL DEFAULT 'queued', | |
`run_time` DOUBLE NULL, | |
`created_dt` DATETIME NOT NULL, | |
PRIMARY KEY (`id`)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class to handle job execution | |
*/ | |
class Jobs extends Onecore_Controller | |
{ | |
const STATUS_DONE = 'done'; | |
const STATUS_QUEUED = 'queued'; | |
const STATUS_RUNNING = 'running'; |
NewerOlder