Download the PHP package tajmahal86/ninja-mutex without Composer
On this page you can find all versions of the php package tajmahal86/ninja-mutex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tajmahal86/ninja-mutex
More information about tajmahal86/ninja-mutex
Files in tajmahal86/ninja-mutex
Package ninja-mutex
Short Description Simple to use mutex implementation that can use flock, memcache, memcached, mysql or redis for locking
License MIT
Homepage https://github.com/arvenil/ninja-mutex
Informations about the package ninja-mutex
About
ninja-mutex is a simple to use mutex implementation for php. It supports different adapters (flock, memcache, mysql, redis, ...) so you can set it up as you wish. All adapters (if set up properly) can be used in multi server environment - in other words lock is shared between web servers.
Usage
Mutex
First you need to choose an adapter and setup it properly. For example if you choose flock implementation first you need to set up NFS filesystem and mount it on web servers. In this example we will choose memcache adapter:
Mutex Fabric
If you want to use multiple mutexes in your project then MutexFabric is the right solution. Set up lock implementor once, and you can use as many mutexes as you want!
Installation
Composer
Download composer:
wget -nc http://getcomposer.org/composer.phar
Add dependency to your project:
php composer.phar require arvenil/ninja-mutex:*
Running tests
Tests require vfsStream to work. To install it, simply run in project dir:
wget -nc http://getcomposer.org/composer.phar && php composer.phar install --dev
To run tests type in a console:
vendor/bin/phpunit
Something doesn't work
Feel free to fork project, fix bugs and finally request for pull