Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/composer.phar
/node_modules/
/build/
/.idea/
/.idea/
src/tmp/*
!src/tmp/empty
37 changes: 0 additions & 37 deletions config/bootstrap_config.php

This file was deleted.

28 changes: 24 additions & 4 deletions src/CakeResqueBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,30 @@
* @since 0.5
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
include getenv('APP') . '../config/bootstrap.php';
use Cake\Console\ShellDispatcher;
use Cake\Console\Shell;
use CakeResque\Resque_Job_Creator;

define('APP', getenv('APP'));
class Resque_Job_Creator
{

new ShellDispatcher($argv);
/**
* Create and return a job instance
*
* @param string $className className of the job to instanciate
* @param array $args Array of method name and arguments used to build the job
* @return object $args a job instance
* @throws Resque_Exception when the class is not found, or does not follow the job file convention
*/
public static function createJob($className, $args)
{
if (!class_exists('Cake\Console\ShellDispatcher')) {
throw new Resque_Exception('Resque_Job_Creator could not find Cake\Console\ShellDispatcher.');
}

array_unshift($args, 'void', $className);
$args[] = '-q';

return [new Cake\Console\ShellDispatcher($args),'dispatch'];

}
}
71 changes: 0 additions & 71 deletions src/Resque_Job_Creator.php

This file was deleted.

5 changes: 4 additions & 1 deletion src/Shell/CakeResqueShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ public function getOptionParser()
])
->addSubcommand('load', [
'help' => __d('cake_resque', 'Load a set of predefined workers.'),
])
->addSubcommand('enqueue', [
'help' => __d('cake_resque', 'Enqueue a job.'),
]);
}

Expand Down Expand Up @@ -1270,7 +1273,7 @@ public function stats()
$this->out("\t - " . __d('cake_resque', 'Delayed Jobs') . " : " . $delayedJobCount);

if ($delayedJobCount > 0) {
$this->out("\t - " . __d('cake_resque', 'Next Job on') . " : " . strftime('%a %b %d %H:%M:%S %Z %Y', $schedulerWorker->nextDelayedTimestamp()));
$this->out("\t - " . __d('cake_resque', 'Next Job on') . " : " . strftime('%a %b %d %H:%M:%S %Z %Y', $schedulerWorker->nextDelayedTimestamp(null,true)));
}
}
$this->out("\n");
Expand Down