Download the PHP package iainp999/lockman without Composer

On this page you can find all versions of the php package iainp999/lockman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lockman

LockMan

A generic locking library for PHP that uses named locks.

Locking is useful for controlling access to resources in a multi-process or distributed environment.

The idea is that the actual locking mechanism can be implemented in any way you like, in order to fit your technology stack. You would just need to implement LockHandlerInterface for a particular technology (there are example lock handlers provided for the local filesystem and the Drupal locking API).

You may have some offline processing involving multiple processes and shared resources, where guarantees about exclusive access to resources are required. In this case, you may want to look into using a library such as this, with an implementation of LockHandlerInterface that is appropriate for you.

See the examples of LockHandlerInterface implementations in lib/LockMan/Handler.

Example Usage

In this case, we assume that there is a class called LockHandler which implements LockHandlerInterface.

General

N.B. in reality, I would recommend using some configurable service/DI container for creating your objects.

Locked Operation

You don't have to use this class, it's simply provided as a convenience for operations that require a lock to be acquired prior to their execution. The lock is released when the operation finishes; if an Exception occurs then the lock is released before the Exception is rethrown. An operation is any PHP callable.

The current implementation does not support the acquisition of multiple locks prior to execution. This may be supported in a future version.

What follows is a contrived example, you could, for example, construct many of these objects in a service container ('contrived' in that you probably wouldn't create all of these objects inline, as in this example).

One important thing to note here is that the $lockedOperation object can be re-used once created. The actual lock is defined by the instance of LockableInterface that is injected when the operation is executed.

The instance could be used, for example, inside a service container (such as the Symfony component) where the class that implements LockHandlerInterface could be defined in configuration and automatically injected into a lock handler 'service'.

Badges

Travis CI : Build Status Coveralls : Coverage Status


All versions of lockman with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iainp999/lockman contains the following files

Loading the files please wait ....