https://github.com/half2me/scheduler
An advanced scheduler plugin for CakePHP
https://github.com/half2me/scheduler
Last synced: 9 months ago
JSON representation
An advanced scheduler plugin for CakePHP
- Host: GitHub
- URL: https://github.com/half2me/scheduler
- Owner: half2me
- License: other
- Created: 2016-12-07T17:36:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-08T21:48:22.000Z (over 9 years ago)
- Last Synced: 2024-12-06T21:55:14.947Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# An advanced scheduler plugin for CakePHP
[](LICENSE.txt)
[](https://packagist.org/packages/halftome/scheduler)
[](https://packagist.org/packages/halftome/scheduler)
## Installation
You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
The recommended way to install composer packages is:
```
composer halftome/scheduler
```
Setup the database with migrations:
```
bin/cake migrations migrate -p Scheduler
```
## Usage
The scheduler will only work if it is invoked, and will only be as precise as the interval it is invoked with.
For an example, here is an example cron job using 1min (the shortest allowed interval on cron) as the interval:
```cron
* * * * * cd /path/to/app && bin/cake Scheduler.Run
```
Here is an example configuration to run 2 tasks:
```php
// For example in your bootstrap.php
Configure::write('Scheduler.jobs', [
'Newsletters' => [
'interval' => '2 weeks',
],
'CleanUp' => [
'interval' => '15 minutes', // every 15min
'command' => 'CleanUpDatabase clean',
'extra' => [
'foo' => 'bar',
],
'timeout' => '15 minutes', // if task has not finished after 15min it will be aborted
],
'QuotaCheck' => [
'interval' => '6 hours',
],
]);
```