开发者

Can I call one CakePHP shell from another?

开发者 https://www.devze.com 2023-01-19 13:03 出处:网络
I have a CakePHP shell program called \'match\', which runs through my databa开发者_如何学Pythonse performing some fairly complicated stuff.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号