senet-eindhoven / cron-runner
Service cron runnner
Installs: 7 124
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 2
Requires
- php: ^7.4||^8.0
- dragonmantank/cron-expression: ^2.3
- psr/log: ^1.0||^2.0||^3.0
- symfony/process: ^5.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4.1
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-01 00:07:08 UTC
README
This module allows you to run both recurring as one time jobs from you application.
Install
composer require senet-eindhoven/cron-runner
Update your server cron to invoke the library every minute
Usage
Inject a valid repository that implements the libary RepositoryInterface
together with a
compatible PSR\Logger
like monolog
.
$repository = new Repository(); $logger = new MyPsrLogger(); $cronService = new CronService($repository, $logger); $cronService->execute();
The execute method will determine if a job needs to be executed or not and will trigger a new process for it.
Development
Run below scripts to verify code quality. On each commit these steps are also executed via GrumPHP
# Startup make up # PHPCS make phpcs # PHPUnit make test