brace/command
Composer 安装命令:
composer require brace/command
包简介
Provides a cli brace command to access di context
README 文档
README
Offers brace-command on command line
Example
$app->command->addCommand("analyze", function (array $arguments = []) { if ($arguments["--thread_id"] !== null) { } }, "", [new CliValueArgument("--thread_id", "Thread ID to analyze")]);
Example
Add this to 10_di.php
$app->addModule(new CommandModule())
And create 30_command.php
$app->command->addCommand("command1", function() { echo "Hello World"; }); // Execute command1 every 5 seconds $app->command->addInterval(5, "command1"); // Support Cron format $app->command->addInterval("* * * * *", "command1"); // Execut once per hour $app->command->addInterval("5 * * * *", "command1"); $app->command->addInterval("5,10,15,20 * * * *", "command1");
Run the Scheduler
brace scheduler
统计信息
- 总下载量: 774
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-15