babacooll/command-planner
最新稳定版本:v0.0.1
Composer 安装命令:
composer require babacooll/command-planner
包简介
Command cron planner
README 文档
README
CommandPlanner is a cron management for Symfony Console component commands.
Installation
CommandPlanner is available through composer :
$ php composer.phar require babacooll/command-planner ~0.0.1
Usage
You can load method in CommandPlanner by two ways :
Example inline
PHP File :
<?php require('vendor/autoload.php'); use CommandPlanner\CommandPlanner; $commandPlanner = new CommandPlanner(); $commandPlanner->add( new \CommandPlanner\Wrapper\CommandWrapper( 'CommandPlanner\Tests\Data\TestCommand', 'Symfony\Component\Console\Application', \Cron\CronExpression::factory('* * * * *'), [ 'parameters' => ['test'], 'log_file' => 'test.log', 'options' => [] ] ) ); $commandPlanner->run();
Example from config
PHP File :
<?php require('vendor/autoload.php'); use CommandPlanner\CommandPlanner; $commandPlanner = new CommandPlanner(); $commandPlanner->addCommandsFromConfig('config/config.yml'); $commandPlanner->run();
Config File :
command_planner: commands: my_first_command: namespace : CommandPlanner\Tests\Data\TestCommand timing: '* * * * * *' parameters: ['test'] options: ['--yell'] log_file: test.log application: Symfony\Component\Console\Application
These examples use CommandPlanner\Tests\Data\TestCommand test command from this package.
TODO
- Unit testing
- Exception handler
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-28