aeolun/symfony-command-cron

根据cron表达式运行Symfony命令

0.1.1 2017-07-03 04:53 UTC

This package is not auto-updated.

Last update: 2024-09-28 13:19:57 UTC


README

Symfony Command Cron ==================== ![build success](https://travis-ci.org/Aeolun/symfony-command-cron.svg?branch=master) ![code quality](https://scrutinizer-ci.com/g/Aeolun/symfony-command-cron/badges/quality-score.png?b=master) [![最新稳定版本](](https://packagist.org.cn/packages/aeolun/symfony-command-cron) [![总下载量](](https://packagist.org.cn/packages/aeolun/symfony-command-cron) [![最新不稳定版本](](https://packagist.org.cn/packages/aeolun/symfony-command-cron) [![许可证](](https://packagist.org.cn/packages/aeolun/symfony-command-cron) 此软件包的功能几乎与正常Symfony控制台应用相同,区别在于运行的命令不是手动确定(例如命令行参数),而是通过一个带有cron语法的文件来决定,这个文件可以与应用程序一起保存在仓库中。创建它的主要原因是需要一些机制来轻松更新和跟踪多个服务器上cron脚本的更改。要求 ------------ - PHP >=5.4 使用 ----- 您的代码将类似于以下(与正常Symfony控制台应用没有太大区别,只是构造函数需要一个cron文件来工作)。 $application = new CronApplication(APPPATH.'config/background.cron'); $application->add(new \Vendor\Command\DoStuff()); $application->add(new \Vendor\Command\DoImportantStuff()); $application->runDueCommands(); cron文件的语法简单,遵循接受的模式。有关可用模式的完整描述,请参阅此处: https://github.com/mtdowling/cron-expression * * * 4 * stuff:do */3 * * * * stuff:important:do 安装 ------- 您可以通过composer安装Symfony Command Cron: composer require aeolun/symfony-command-cron:dev-master