问题
I have just started using resque in my application, I have created a worker and can queue jobs up. I am having issues though using illuminate classes in my worker. below is the error i am seeing in the worker.
PHP Fatal error: Class 'Redis' not found in path/to/worker
Here is my worker class:
class SvrRestart {
public function setUp() {
// ... Set up environment for this job
}
public function perform() {
$instance = $this->args['instance'];
Redis::del('restart:' . $instance);
}
public function tearDown() {
// ... Remove environment for this job
}
}
I have also tried adding the following to the top of the worker:
use Illuminate\Support\Facades\Redis as Redis
this returns the following error:
PHP Fatal error: Call to a member function del() on a non-object in path/to/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 206
do I need to do something special to use illuminate classes in my worker?
来源:https://stackoverflow.com/questions/20527586/unable-to-call-illuminate-class-from-resque-worker