michaelbasford / php-cli
使用 Symfony 的 Console 组件的 PHP 命令行应用程序模板。
dev-master
2019-05-13 04:02 UTC
Requires
- monolog/monolog: v2.x-dev
- pimple/pimple: 3.2.3
- symfony/console: v4.3.x-dev
- symfony/yaml: v4.3.x-dev
This package is not auto-updated.
Last update: 2024-09-24 03:59:39 UTC
README
一个使用 Symfony 的 Console 组件的 CLI 应用程序模板。
创建新应用
$ composer create-project michaelbasford/php-cli:dev new-project-dir/
$ cd new-project-dir/
运行您的应用
$ chmod +x bin/application
$ bin/application
php-cli application version 0.0.1
Usage:
[options] command [arguments]
Options:
--help (-h) Display this help message.
--quiet (-q) Do not output any message.
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
--version (-V) Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction (-n) Do not ask any interactive question.
Available commands:
help Displays help for a command
list Lists commands
example
example:command An example command.
示例命令
$ bin/application example:command
Hello, World!
移除示例
从 bin/application 中移除以下行
$application->add(
new Example\ExampleCommand($container)
);
然后移除文件夹 $ rm -r src/Example