task/console
最新稳定版本:v0.4.0
Composer 安装命令:
composer require task/console
包简介
Utilities for working with Symfony's Console component and Task
README 文档
README
Example
use Some\Application; use Task\Plugin\Console\ApplicationPlugin; $project->inject(function ($container) { $app = new Application; $container['app'] = new ApplicationPlugin($app) }); $project->addTask('run', ['app', function ($app) { $app->command('run') ->setVerbose(true) ->pipe($this->getOutput()); }]);
Installation
Add to composer.json:
... "require-dev": { "task/console" "~0.2" } ...
Usage
ApplicationPlugin::command() returns a CommandRunner which dynamically builds up command arguments and options with setter methods.
Given the following InputDefinition:
[
new InputOption('option', 'o', InputOption::VALUE_REQUIRED),
new InputOption('flag', 'f', InputOption::VALUE_NONE),
new InputArgument('arg', InputArgument::REQUIRED)
]
$project->addTask('run', ['app', function ($app) { $app->command('run') ->setOption('foo') ->setFlag(true) ->setArg('wow') ->pipe($this->getOutput()); }]);
统计信息
- 总下载量: 17.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-04-23