jbroudou/cronlock

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

dev-master 2018-01-04 06:43 UTC

This package is auto-updated.

Last update: 2019-07-29 02:26:48 UTC


README

A simple ZF2 module that provides locking functionality for cron type console actions.

To install add the following to your project's composer.json

"jbroudou/cronlock": "dev-master"

To enable locking functionality of a console action set the cronLock parameter of the route's default options. e.g.

'my-end-point' => array(
                    'options' => array(
                        'route'    => 'my-end-point',
                        'defaults' => array(
                            'controller' => 'Project\Controller\Cron',
                            'action'     => 'runCron',
                            'cronLock' => true,
                        )
                    )
                )

Set the directory where lock files will be created by specifying a cronLockDir config in your project's auto load config. If not set, the module will default to the /tmp directory.