Once upon a time, the acronym PHP stood for Personal Home Page. Even after the language was renamed and the initials resolved to the recursive PHP Hypertext Preprocessor, the name remained overtly a webby affair. Nonetheless, PHP works very well on the command line. In fact, if you’re sure that your target environment will furnish you with the PHP interpreter, it may be the best possible tool for your shell scripting tasks. Written in the right way, a PHP script created for the command line can do everything that a more traditional shell script can do, with all the power and familiarity of a fully featured object-oriented language and the rich library infrastructure provided by Composer.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

PHP on the Command Line

  • Matt Zandstra

摘要

Once upon a time, the acronym PHP stood for Personal Home Page. Even after the language was renamed and the initials resolved to the recursive PHP Hypertext Preprocessor, the name remained overtly a webby affair. Nonetheless, PHP works very well on the command line. In fact, if you’re sure that your target environment will furnish you with the PHP interpreter, it may be the best possible tool for your shell scripting tasks. Written in the right way, a PHP script created for the command line can do everything that a more traditional shell script can do, with all the power and familiarity of a fully featured object-oriented language and the rich library infrastructure provided by Composer.