/zf2-cron-module

Primary LanguagePHPBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Build Status Coverage Status ZF2 implementation for Cron/Cron

Installation

Installation of CronModule uses composer. For composer documentation, please refer to getcomposer.org.

php composer.phar require bitweb/zf2-cron-module:2.0.*

or add to your composer.json

"require": {
  "bitweb/zf2-cron-module": "2.0.*"
}

Then add BitWeb\CronModule to your config/application.config.php

Installation without composer is not officially supported, and requires you to install and autoload the dependencies specified in the composer.json.

Configuration

Add to your configuration:

'cronModule' => [
    'phpPath'    => 'php',
    'scriptPath' => '/path/to/application/public/folder/',
    'jobs'       => [
        [
            'command'  => 'index.php application cron do-job',
            'schedule' => '* * * * *'
        ]
    ]
]

You can also get the configutation file sample from config folder config/cronModule.config.php.dist.

Run cron job from command line

php index.php cron module start