Skip to content


Subversion checkout URL

You can clone with
Download ZIP
CakePHP PHP-Resque Plugin
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

CakePHP PHP-Resque Plugin by Mike Smullin

** Lets you use Resque within the CakePHP environment, complete with cake shell. **

Installation & Usage

Place this directory in your plugins dir:

git submodule add git:// ./app/plugins/resque/

Download the latest version of Chris Boulton's php-resque into ./app/plugins/resque/vendors/php-resque/, as well:

git submodule update --init --recursive

Edit the file ./app/plugins/resque/config/resque.php and remember to configure whatever and port are appropriate for your environment:

switch (Configure::read('YourApp.environment')) {

$config['Resque']['Redis'] = array(
  'host' => 'localhost',
  'port' => 6379

Then launch a new php-resque-worker fork, which will begin polling the master Resque server for new jobs to run locally:

cake resque help # to see available options
cake resque start

How to Queue a Job

var $components = array('Resque.Resque');

function action() {
  Resque::enqueue('default', 'YourJobClass1', array($any, $params)); // queue it up

or you can use the CakePHP Shell:

cake resque jobs # to see a list of available jobs
cake resque enqueue YourJobClass1 any other params

How to Write a Job

in the above example it would be a file saved as:


and the code would look like:

class YourJobClass1 extends ResqueShell {
  function perform() {
    # CakePHP environment is within scope via ResqueShell base class and App::import()
    $users = $this->User->find('all');
    // ...

AND make sure to cake resque restart with each change to any of your job classes.


CakePHP-PHP-Resque is written by Mike Smullin and is released under the WTFPL.

PHP-Resque is written by Chris Boulton see

Based on Resque by defunkt see

Something went wrong with that request. Please try again.