Download the PHP package hollyit/laravel-lock without Composer
On this page you can find all versions of the php package hollyit/laravel-lock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hollyit/laravel-lock
More information about hollyit/laravel-lock
Files in hollyit/laravel-lock
Package laravel-lock
Short Description A Laravel wrapper for the Symfony Lock component to provide semaphore style locks on long running processes.
License MIT
Homepage https://github.com/hollyit/laravel-lock
Informations about the package laravel-lock
Laravel Lock
Description
A simple Laravel wrapper for the Symfony lock component to provide semaphore locking.
Why?
When you have routines that take a longer time than usual to run, you may not want other processes attempting to run it. To prevent this you can acquire what is referred to as a lock or semaphore. This prevents problems of contention.
Installation
You can install the package via composer:
Usage
Currently supported drivers
Drivers can be configured in config/lock.php. View that file for additional details. To publish the configuration
File Drive:
(This is a wrapper of the Symfony FlockStore)
No additional setup required. By default this will use the system's temporary directory. You may override this in config or environment. Please see config/lock.php for details.
With the exception of Database, drivers are very simple wrappers. If you would like to add additional drivers, please consider a PR.
Database driver:
(This is a modification of the PdoStore, modified to use Laravel's database layer)
This will use your default database connection. Before using this driver you must publish and migrate your database.
If you wish to use a custom table name, then please modify your config/lock.php file prior to migrating.
Redis:
Redis isn't currently supported, but it will in a future release.
Custom drivers:
Other stores from the Symfony/lock package aren't currently supported. Migrating them over should be rather simple if you would like to (and please submit a PR).
You may also define custom drivers outside of what the original symfony/lock package offers. Under your config/lock.php configuration file, simple define a 'class' property to point to the class of the new driver. Drivers must implement the \Hollyit\LaravelLock\Contracts\LockDriver contract.
Additional details
For additional details and features, please refer to the Symfony Lock documentation.
Testing
NOTE: Testing is extremely limited at this time given the need for this package on a client project. If you are willing to expand on test coverage, please do so and submit a PR.
Contributing
This package was quickly developed due to the need of a current client project. If you would like to add more drivers, features or tests, then your help will be greatly welcomed.
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Jamie Holly
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-lock with dependencies
illuminate/support Version ~5.5.0|~5.6.0|~5.7.0|~5.8.0|~6.0.0
symfony/lock Version ^4.3
ext-pdo Version *