chrisboulton/php-resque — Issue #44: Job perform method should be static, and job classes should not be instantiated
Author: chrisboulton
Created: 2012-03-02 00:47:19+00:00
State: open

php-resque behaves differently to the Ruby equivalent in that it currently instantiated job classes when running jobs(e.g `$job = new $jobName(); $job->perform()`. It also has `setUp` and `tearDown` methods which the Ruby version does not.

The problem is, php-resque does NOT know how to instantiate your classes, which means if you have classes that require arguments to the constructor, you are SOL.

It makes sense for php-resque to statically call the perform method on classes, and then leave it up to your class to then instantiate itself if required. There is also no need for the `setUp` and `tearDown` methods as these would be handled in the statically called `perform` method.

This change is going to break compatibility with all current jobs, and require people to update their code.