2017-25 © Pedro Peláez
 

library lock

Simple object-oriented file lock management

image

benconstable/lock

Simple object-oriented file lock management

  • Wednesday, January 7, 2015
  • by BenConstable
  • Repository
  • 1 Watchers
  • 8 Stars
  • 265 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 4 Versions
  • 3 % Grown

The README.md

Lock

Build Status Latest Stable Version License, (*1)

The standard PHP flock function is difficult to test against. This library provides a modern, object-oriented wrapper to flock., (*2)

Installation

Add the following to your composer.json:, (*3)

{
    "require": {
        "benconstable/lock": "~1.0"
    }
}

Usage

<?php

$lock = new BenConstable\Lock\Lock('/path/to/file.txt');

try {
    $lock->acquire();

    // Lock successful...

    // Release lock. Optional, as resource will also be released automatically
    // when the lock object is destroyed

    $lock->release();
} catch (BenConstable\Lock\Exception\LockException $e) {
    // Lock failed...
}

Development & contribution

To develop and/or contribute to this library, you must add tests for your code. Tests are built with Phpspec. To run them:, (*4)

$ git clone https://github.com/BenConstable/lock && cd lock/
$ composer install
$ bin/phpspec run

The Versions

07/01 2015

dev-master

9999999-dev http://github.com/BenConstable/lock

Simple object-oriented file lock management

  Sources   Download

MIT

The Requires

  • php >= 5.3

 

The Development Requires

lock flock filelock

07/01 2015

v1.0.2

1.0.2.0 http://github.com/BenConstable/lock

Simple object-oriented file lock management

  Sources   Download

MIT

The Requires

  • php >= 5.3

 

The Development Requires

lock flock filelock

07/01 2015

v1.0.1

1.0.1.0 http://github.com/BenConstable/lock

Simple object-oriented file lock management

  Sources   Download

MIT

The Requires

  • php >= 5.3

 

The Development Requires

lock flock filelock

16/11 2014

v1.0.0

1.0.0.0 http://github.com/BenConstable/lock

Simple object-oriented file lock management

  Sources   Download

MIT

The Requires

  • php >= 5.3

 

The Development Requires

lock flock filelock