Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

More patches for cakePHP 3 #92

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

More patches for cakePHP 3 #92

wants to merge 6 commits into from

Conversation

manierim
Copy link

A few changes I made to actually be able to let Jobs be correctly executed as CakePHP 3 Shells.
These goes together with the PR#34 on php-resque-ex

Main things:

  • no longer look for a perform method in the Shell but use the runCommand method
  • to be able to do this, CakeResque/Resque_Job_Creator now returns an array with instance and method name
  • a few namespacing issues fixed

manierim added 6 commits July 29, 2015 12:45
- Resque_Job_Creator cannot be in namespace CakeResque in order to be found by Resque_Job->getIntance;
- so in CakeResqueBootstrap we `require Resque_Job_Creator.php` insetad of trying autoload with `use CakeResque/Resque_Job_Creator`;
- self::$rootFolder correctly points to src
- $model (Shell class) is now properly namespaced (App\Shell)
- removed perform method search, replaced returning the method to invoke (runCommand) as well as the class instance as an array

Removed bootstrap_config since CakePHP 3 no longer supports arrays of files as plugin bootstrap value
(to init CakeResque with values different from defaults plugin must be loaded with no bootstrap enabled and then CakeResque::init must be called with the config values)

Improved Exceptions messages:
- explicit being thrown by Resque_Job_Creator
- diffrentiate between file not found and class not found in file
- Resque_Job_Creator.php is no longer needed, Resque_Job_Creator is defined in CakeResqueBootstrap.php
- Resque_Job_Creator does not need to inspect anything since everything is nicely handled by the Cake\Console\ShellDispatcher->dispatch method
- the args list must mock the 0th element from cli (file name: 'void')
…e to locate CakePHP bootstrap itself

- The Job will be run with the Cake Console switch -q to avoid cluttering log files
…Shell->stats it needs to look for the next job to be executed, "future" included.
oanhnn pushed a commit to rikkeisoft/Cake-Resque that referenced this pull request Mar 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant