2017 © Pedro Peláez
 

library component_lock

php component lock

image

net_bazzline/component_lock

php component lock

  • Friday, January 26, 2018
  • by artodeto
  • Repository
  • 1 Watchers
  • 0 Stars
  • 962 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

Process Lock Component

The build status of the current master branch is tracked by Travis CI: Build Status, (*1)

Latest stable, (*2)

The scrutinizer status is: code quality, (*3)

The versioneye status is: Dependency Status, (*4)

Minimum PHP version is: Minimum PHP Version, (*5)

Take a look on openhub.net., (*6)

General

This component provides the LockInterface as well as an LockAwareInterface. It comes with two implementations of the LockInterface., (*7)

You can use this interface to lock classes or processes to prevent changes in an object (so you freeze/lock the class for property setting) or lock an existing process (like a cronjob) to prevent double execution., (*8)

This component was created by splitting up the PHP_Bazzline_Utility repository., (*9)

Implementations

Two implementations exists. The FileNameLock and the RuntimeLock., (*10)

RuntimeLock

The RuntimeLock can be used to lock an instance from modification. If you implement an check in each setter method, you can easily create a instance (by a factory for example) and lock it afterwards to prevent modifications., (*11)

FileNameLock

The FileNameLock can be used to lock an class from instantiated multiple times. This is useful if you implement this in cronjobs or business processes that should run alone., (*12)

FileHandlerLock

The FileHandlerLock can be used to lock file with php`s flock functionality., (*13)

Future Improvements

  • implement "wait" like implemented here.
  • take a look to the semaphore project to see if thing can be merged
  • take a look if all projects can work together
  • take a look to havvg/lock

History

  • upcomming
    • @todo
  • 2.3.0 - released 2017-01-26
    • updated minimum requirements to php 5.6
  • 2.2.1 - released 2016-06-29
    • added integrationtest for php 7.0
    • added links to:
      • latest stable build
      • scrutinizer code quality
      • versioneye dependency status
    • migrated to psr-4 autoloading
    • removed integrationtest for php 5.3.3
  • 2.2.0 - released 2016-06-28
    • added phpunit 5.4 as dependency (if php version is fitting)
    • added process id into the lock file as requested as feature
    • updated dependencies
  • 2.1.0 - released 2015-09-10
    • implemented support for SplFileObject in FileHandlerLock
  • 2.0.1 - released 2015-09-09
    • stabalized dependencies
  • 2.0.0 - released 2015-09-08
    • added FileHandlerLock
    • renamed FileLock to FileNameLock
    • renamed "getName" to "getResource" and "setName" to "setResource" in "LockInterface"
  • 1.0.3
    • added LockDependentInterface
  • 1.0.2
    • added constructor with optional parameter $name for FileNameLock and RuntimeLock
  • 1.0.1
    • switched to LGPLv3
  • 1.0.0
    • added implementation for FileLock and RuntimeLock
    • covered implementations with unittest
    • finished LockInterface and LockAwareInterface

Final Words

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it. Donate something if you love it :-]., (*14)

The Versions

26/01 2018

dev-master

9999999-dev https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3 LGPL-3.0-or-late

The Requires

  • php ^5.6||^7.0

 

The Development Requires

component php lock net_bazzline

26/01 2017

2.3.0

2.3.0.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php ^5.6||^7.0

 

The Development Requires

component php lock net_bazzline

29/06 2016

2.2.1

2.2.1.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

28/06 2016

2.2.0

2.2.0.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

10/09 2015

2.1.0

2.1.0.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

09/09 2015

2.0.1

2.0.1.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

08/09 2015

2.0.0

2.0.0.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

24/04 2014

1.0.3

1.0.3.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

05/08 2013

1.0.2

1.0.2.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

31/07 2013

1.0.1

1.0.1.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

LGPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline

01/07 2013

v1.0.0

1.0.0.0 https://github.com/stevleibelt/php_component_lock

php component lock

  Sources   Download

GPLv3

The Requires

  • php >=5.3.3

 

The Development Requires

component php lock net_bazzline