<commit_before>[![Build Status](https://travis-ci.org/BitWeb/zf2-cron-module.svg?branch=master)](https://travis-ci.org/BitWeb/zf2-cron-module)
[![Coverage Status](https://coveralls.io/repos/BitWeb/zf2-cron-module/badge.png?branch=development)](https://coveralls.io/r/BitWeb/zf2-cron-module?branch=master)
[ZF2](https://github.com/zendframework/zf2) implementation for [Cron/Cron](https://github.com/Cron/Cron)
===============

### Installation

Installation of CronModule uses composer. For composer documentation, please refer to
[getcomposer.org](http://getcomposer.org/).

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

or add to your composer.json
```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:

```php
'cronModule' => [
    'phpPath'    => 'php',
    //scriptPath will default to your root aplication public folder
    '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: 

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

Options for cron jobs:

| 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`.


#### Run cron job from command line
```sh
php index.php cron module start
```<commit_msg>Add link to cron syntax in wikipedia.<commit_after>[![Build Status](https://travis-ci.org/BitWeb/zf2-cron-module.svg?branch=master)](https://travis-ci.org/BitWeb/zf2-cron-module)
[![Coverage Status](https://coveralls.io/repos/BitWeb/zf2-cron-module/badge.png?branch=development)](https://coveralls.io/r/BitWeb/zf2-cron-module?branch=master)
[ZF2](https://github.com/zendframework/zf2) implementation for [Cron/Cron](https://github.com/Cron/Cron)
===============

### Installation

Installation of CronModule uses composer. For composer documentation, please refer to
[getcomposer.org](http://getcomposer.org/).

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

or add to your composer.json
```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:

```php
'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: 

| 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:

| Option | Description |
|--------|-------------|
| command | the php script command to be run |
| schedule | A valid [Cron schedule](https://en.wikipedia.org/wiki/Cron) |


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


#### Run cron job from command line
```sh
php index.php cron module start
```
{'fraction_non_alphanumeric': 0.1698960302457467, 'fraction_numerical': 0.006143667296786389, 'mean_word_length': 3.2585513078470827, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4341404', 'n_tokens_mistral': 1380, 'n_tokens_neox': 1312, 'n_words': 346}