2017 © Pedro Peláez
 

library pid-helper

A small helper class used to help you check if code is still running

image

andrewfenn/pid-helper

A small helper class used to help you check if code is still running

  • Sunday, October 11, 2015
  • by andrewfenn
  • Repository
  • 2 Watchers
  • 1 Stars
  • 3,741 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

PID Helper

Software License Quality Score, (*1)

Total Downloads Total Downloads Total Downloads, (*2)

Just a small helper class designed to allow you to easily keep track of code that is already running so that it doesn't run twice., (*3)

Why yet another PID helper class?

I wanted a process checker that did things properly on linux. It uses the /proc interface to see if the process is still running. On OSX it uses the ps command., (*4)

There is no windows support in this library. If you'd like to add it then please submit a pull request that does something similar to the OSX or Linux implementations., (*5)

How to install

Add the following to your composer.json file and run composer update., (*6)

    "require": {
        "andrewfenn/pid-helper": "0.1.0"
    }

How to use

To use it call the code as shown below. This class will check that the process id is still running or not., (*7)

<?php
use PidHelper/PidHelper;

$pidHelper = new PidHelper('/path/to/dir/', 'process.pid');

if (!$pidHelper->lock()) {
    exit("Script Running\n");
}

// .... Your code ....

// Optional
$pidHelper->unlock();

The Versions

11/10 2015

dev-master

9999999-dev

A small helper class used to help you check if code is still running

  Sources   Download

MIT

The Requires

  • php >=5.5

 

process pid

01/09 2015

0.1.0

0.1.0.0

A small helper class used to help you check if code is still running

  Sources   Download

MIT

The Requires

  • php >=5.5

 

process pid