flagrow / console
0.7.0
2021-03-08 20:03 UTC
Requires
- dragonmantank/cron-expression: ^3.1.0
- flarum/core: ^0.1.0-beta.16
- illuminate/console: ^8.0
- illuminate/support: ^8.0
- symfony/process: ~5.0
README
此包旨在为扩展开发者提供将任务调度添加到 Flarum 的功能。
在您的扩展中使用
在您的扩展 composer.json
文件中简单引用它。
"require": { "fof/console": "^0.6" },
现在请确保在 Flarum 中注册了 ConsoleProvider
。您的 extend.php
文件中有一个扩展器可以帮助您完成此操作。
return [ new \FoF\Console\Extend\EnableConsole, // .. your code ];
任务调度,cron 作业
要设置计划,创建一个 服务提供者,它通过 IoC 解决 Illuminate\Console\Scheduling\Schedule
,然后使用其方法配置命令的计划,请参阅 任务调度文档。