michaelbasford/

php-cli

使用 Symfony 的 Console 组件的 PHP 命令行应用程序模板。

安装: 27

依赖: 0

建议: 0

安全: 0

星标: 12

关注者: 1

分支: 0

公开问题: 0

类型:项目

dev-master 2019-05-13 04:02 UTC

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

包含的组件