Closed sameg14 closed 8 years ago
I disagree. It's easy to write a wrapper script that handles including other scripts; there's no good reason to support this, as it's only intended to initialize enough logic for jobs to run. It's up to the developer to ensure that script loads everything required.
This use case is specifically for Symfony. The only way I can get the jobs to recognize autoloaded classes is to include "both" autoloaders
app/autoload.php
php-resque/vendor/autoload.php
I have forked the repo and made this change, it is non invasive, and if people want to use it all they have to do is something like this
COUNT=20 APP_INCLUDE=/home/vagrant/symfony_project/app/autoload.php,/home/vagrant/php-resque/vendor/autoload.php QUEUE=high nohup php php-resque/bin/resque &
This is the commit fyr https://github.com/sameg14/php-resque/commit/9fe275cecbb5f9de4d484763b0b60f5d8e2f750e
Like I said, it's easy to write a wrapper script that loads everything you need loaded. Your APP_INCLUDE
would point to the wrapper script (say, load_autoloaders.php
), which in turn loads in both autoloaders. This is the preferred method of using APP_INCLUDE
, though the best use case actually avoids APP_INCLUDE
altogether by having the wrapper script also include the Resque start script, and then be called directly.
Currently it does not seem possible to add multiple APP_INCLUDE This should be supported, and they should be separated by "," as such
in bin/resque on line 61