Created
September 24, 2015 02:58
-
-
Save paulwsmith/5b30399d906a3420901a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* CakePHP 2.x -- add this code to a controller and then access the controller's route from the browser. | |
* This allows you to trigger shells through the browser, so that you can use xdebug if it cannot be accessed | |
* through the command line | |
*/ | |
App::uses('ShellDispatcher', 'Console'); | |
public function index() { | |
$argv = array( | |
'Queue.Queue', | |
'runworker', | |
'--group', | |
'some_group' | |
); | |
$dispatcher = new ShellDispatcher($argv, false); // false prevents bootstrap code from running | |
return ($dispatcher->dispatch() === false ? 1 : 0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment