Can I call one CakePHP shell from another?
I have a CakePHP shell program called 'match', which runs through my databa开发者_如何学Pythonse performing some fairly complicated stuff.
I'm writing another shell so I can do some proof-of-concept simulation, this shell is called 'simulate'.
I need 'simulate' to be able to call 'match', then continue running. As the simulation will repeat many different scenarios over and over, manually running 'match' is not an option.
I've tried to App::import('shell','match'), but to no avail.
Help! Thanks.
You could move the shared functionality into a task and then call this task from both shells, see http://book.cakephp.org/view/1109/Tasks
You could use $this->dispatchShell to run another cake shell.
http://book.cakephp.org/2.0/en/console-and-shells.html
加载中,请稍侯......
精彩评论