PHPackages                             ondrejd/zf2-cron-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ondrejd/zf2-cron-helper

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ondrejd/zf2-cron-helper
=======================

Module for Zend Framework 2 that simplify dealing with CRON tasks in your PHP projects.

392[1 issues](https://github.com/ondrejd/zf2-cron-helper/issues)PHP

Since Mar 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/ondrejd/zf2-cron-helper)[ Packagist](https://packagist.org/packages/ondrejd/zf2-cron-helper)[ RSS](/packages/ondrejd-zf2-cron-helper/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

zf2-cron-helper
===============

[](#zf2-cron-helper)

[![Build Status](https://camo.githubusercontent.com/cf4d1e13c1add978bb58455a60a03ff3818c4617907e19772efc4873d0071be0/68747470733a2f2f7472617669732d63692e6f72672f6f6e6472656a642f7a66322d63726f6e2d68656c7065722e737667)](https://travis-ci.org/ondrejd/zf2-cron-helper)

Module that simplify dealing with CRON jobs in your PHP projects based on [Zend Framework 2](http://framework.zend.com/).

> This module is heavily inspired by [zf2-cron](https://github.com/heartsentwined/zf2-cron) module. Formely I wanted to use this module instead of creating my own but I dislike using of YAML and dependency on Doctrine - beside it's look like the code is not maintained anymore... But still it was the start point and good learning source.

Features
--------

[](#features)

1. No other dependencies than [Zend Framework 2](http://framework.zend.com/)
2. Entry-point for all CRON jobs of your application
3. Pre-configured CRON jobs can be modified or triggered outside the regular timeplan
4. Simple registering one-time CRON jobs directly from the code
5. Advanced logging features with optional background - defaultly SQLite database but you can provide your own database adapter
6. `EventManager` is used so you can easilly append new actions
7. All code is well documented and tested

Installation
------------

[](#installation)

**CronHelper** was created especially for pure [Zend Framework 2](http://framework.zend.com/) applications and description below presumes that you want to add this module into such application.

In short, you need do this:

1. register new dependency for the [Composer](https://getcomposer.org/)
2. add **zf2-cron-helper** module to modules listed in your `config/application.config.php`
3. create `config/autoload/cronhelper.config.php` configuration file to set up the module
4. create the database table for logging if needed
5. and that's all

Here is detailed description:

### Composer.json file

[](#composerjson-file)

Below is example `composer.json` file for a simple application:

```
{
  "name": "My application",
  "description": "Application using zf2-cron-helper module",
  "version": "1.0.0",
  "type": "project",
  "keywords": ["commerce","website"],
  "homepage": "http://my.project.com/",
  "license": "MPL-2.0",
  "authors": [{
    "name": "Ondřej Doněk",
    "email": "ondrejd@gmail.com",
    "homepage": "http://ondrejdonek.blogspot.com/",
    "role": "Developer"
  }],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.zendframework.com/"
    }, {
      "type": "git",
      "url": "https://github.com/ondrejd/zf2-cron-helper"
    }
  ],
  "require": {
    "php": ">=5.4",
    "zendframework/zendframework": "2.2.*",
    "ondrejd/zf2-cron-helper": "dev-master"
  }
}
```

### Application config

[](#application-config)

Find the main configuration file of your application (usually `config/application.config.php`) and modify this file. Here is the very simple version how it can look like:

```
