bastiendonjon/pid-file-manager

There is no license information available for the latest version (1.1.2) of this package.

PID file manager for prevent overlapping in cron task

1.1.2 2016-09-27 14:50 UTC

This package is not auto-updated.

Last update: 2024-03-16 17:04:17 UTC


README

PID Manager for prevent overlapping in cron task

Requirements

  • PHP >= 5.4.0

Composer installation

You must modify your composer.json file and run composer update to include the latest version of the package in your project:

"require": {
    "bastiendonjon/pid-file-manager": "1.0.*"
}

Or you can run the composer require command from your terminal:

composer require bastiendonjon/pid-file-manager

Usage

// Usage in simple task :
$elem = new PIDFileManager('myProcessName', storage_path());
$elem->start();

// Usage in daemon task :
$elem = new PIDFileManager('myProcessName', storage_path());
$elem->start();

// Add oneTime if you demonize your script
while(true) {
    sleep(1)
    $elem->oneTime();
}