-
Notifications
You must be signed in to change notification settings - Fork 56
PHP Fatal error: Class 'AppShell' not found #82
Comments
Do you also have this error when trying to execute the job directly in the shell ? |
If I add
to the EmailQueueWorkerShell I can |
Here is my full EmailQueueWorkerShell.php:
|
Do you have an 'exotic' installation ? Did you install CakePHP via composer too ? Did you install the plugin in another folder ? |
I don't think I have anything exotic, but this is a medium-sized app.
Any suggestions of what I could check? |
I have been setting up CakeResque today and noticed the same problem. In my case I just needed to explicitly load AppShell:
The example shell in the 'creating job classes' docs does reference this, but it's easy to miss. Thanks for a great plugin. |
Ah yes, that corrected the issue for me. The manual AppShell reference is mentioned at http://cakeresque.kamisama.me/usage#jobs but not http://cakeresque.kamisama.me/usecases#sending-emails . Thanks domstubbs and kamisama. Leaving this open so kamisama can reference it when updating the docs :) |
@wa0x6e Do you also have this error when trying to execute the job directly in the shell? Class 'App' not found in |
CakePHP 2.6.1, PHP 5.5.9, Ubuntu 14, cake-resque installed via composer:
"kamisama/cake-resque": "4.1.*"
I'm following the tutorial at http://cakeresque.kamisama.me/usecases#sending-emails almost exactly, but receiving the following (abbreviated) error in resque-worker-error.log:
PHP Fatal error: Class 'AppShell' not found in [...]/app/Console/Command/EmailQueueWorkerShell.php on line 4
Here are the first 4 lines of EmailQueueWorkerShell.php:
The worker was started with
Console/cake CakeResque.CakeResque start --queue email
Here's the queue code, from within an event listener:
CakeResque::enqueue('email', 'EmailQueueWorkerShell', array('sendEmail', $config));
where $config is an Array.I do have an AppShell in my project's Command directory, with the
perform()
method added per the tutorial. AppShell is otherwise empty. I also have other shells extending AppShell which I can run without issue.The text was updated successfully, but these errors were encountered: