chrisboulton / php-resque

PHP port of resque (Workers and Queueing)
MIT License
3.43k stars 759 forks source link

PHP Fatal error: Call to undefined method Resque::fork() in /home/vagrant/php-resque/bin/resque on line 98 #201

Closed sameg14 closed 10 years ago

sameg14 commented 10 years ago

This is the command that I am running to start resque, with 5 workers on the queue queue1

~/php-resque/bin ] $ COUNT=5 APP_INCLUDE=/home/app/autoload.php QUEUE=queue1 php resque
//Line 98 in bin/resque
$pid = Resque::fork();

Why is the fork() method not a part of the code?

sameg14 commented 10 years ago

I answered my own question. I had to include the vendor/autoload.php file using APP_INCLUDE like so.

COUNT=5 APP_INCLUDE=~/app/autoload.php APP_INCLUDE=~/php-resque/vendor/autoload.php QUEUE=queue1 php bin/resque
sameg14 commented 10 years ago

So It looks like the 1.2 tag does not contain the function definition for the fork() method i.e. Resque::fork() does not exist in 1.2!

"chrisboulton/php-resque": "1.2.x"
danhunsaker commented 10 years ago

1.2 also doesn't contain a bin/resque file. The resque.php in the repo root is its equivalent script.