使用Symfony \\ Console进行交互式php cli应用程序
I want to develop an interactive command based php application, so I did some research and bumped into the Symfony\\Console component. 我想开发一个基于交互式命令的php应用程序,所以我做了一些研究并碰到了Symfony \\ Console组件。 This is great, because it lets met run 这很棒,因为它让我遇到了运行
However, the script then runs the command and closes, and I want to be able to run another command. 但是,脚本然后运行命令并关闭,我希望能够运行另一个命令。 So basically, something like 所以基本上,像
Which then listens on php://stdin for commands, structured as 然后在php:// stdin上搜索命令,结构为
then runs the command and starts listening for new commands. 然后运行该命令并开始侦听新命令。 When a specific "exit" command is run, the script should terminate. 运行特定的“exit”命令时php交互,脚本应终止。 I'm relatively new to Symfony and the Console component, so any thoughts on how to implement this, using Symfony\\Console? 我对Symfony和Console组件比较陌生,所以有关如何使用Symfony \\ Console实现这一点的想法? Because I really like the way how Symfony\\Console abstracts all the command-stuff away. 因为我非常喜欢Symfony \\ Console如何抽象出所有命令的东西。 (编辑:晋中站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |