2017 © Pedro Peláez
 

library zf2-cron-module

BitWeb ZF2 module for cron.

image

bitweb/zf2-cron-module

BitWeb ZF2 module for cron.

  • Wednesday, November 16, 2016
  • by tobre
  • Repository
  • 13 Watchers
  • 13 Stars
  • 19,849 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 10 Versions
  • 2 % Grown

The README.md

Build Status Coverage Status, (*1)

ZF2 implementation for Cron/Cron

Working with Zend Framework 3? We've got you covered.

Installation

Installation of CronModule uses composer. For composer documentation, please refer to getcomposer.org., (*2)

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

or add to your composer.json, (*3)

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

Then add BitWeb\CronModule to your config/application.config.php, (*4)

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

Configuration

Add to your configuration:, (*6)

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

General options:, (*7)

Option Description
phpPath path to the php executable, usually "php"
scriptPath path to your applications public folder, defaults to your root aplication public folder
jobs an array of jobs and their schedules
timeout timeout for the cron job

Options for cron jobs:, (*8)

Option Description
command the php script command to be run
schedule A valid Cron schedule

You can also get the configutation file sample from config folder config/cronModule.config.php.dist., (*9)

Run cron job from command line

php index.php cron module start

The Versions

06/05 2014