Download the PHP package simple-as-fuck/laravel-lock without Composer
On this page you can find all versions of the php package simple-as-fuck/laravel-lock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download simple-as-fuck/laravel-lock
More information about simple-as-fuck/laravel-lock
Files in simple-as-fuck/laravel-lock
Package laravel-lock
Short Description Laravel integration for symfony/lock.
License
Informations about the package laravel-lock
Simple as fuck / Laravel lock
Laravel integration for symfony/lock.
Installation
Support
If any PHP platform requirements in composer.json ends with security support, consider package version as unsupported except last version.
Configuration
Add into your .env_example and configure your environment on server.
Supported symfony lock store are only with native blocking lock, because it is fucking effective.
-
LOCK_STORE=semaphore
SemaphoreStore recommended for simple production without application server replication (lock are stored in local ram) -
LOCK_STORE=flock
FlockStore recommended for local development, (lock are stored in local filesystem, so it should work everywhere) -
LOCK_STORE=pgsql
PostgreSqlStore recommended for big production with application server replication (lock are stored remotely by postgres database), you can use special database for locks using setting laravel database connection nameLOCK_PGSQL_STORE_CONNECTION=some_postgre_sql_connection_name
, by default is used default database connection -
LOCK_PREFIX=null
package will use'app.name'
config value as lock keys prefix -
LOCK_PREFIX=empty
orLOCK_PREFIX=""
env sets prefix to empty string, simply turn off lock keys prefixing LOCK_PREFIX="some_prefix"
env sets custom prefix and override prefix from application name
⚠ Changing lock configuration is dangerous operation. ⚠
If you need change lock store, you can use environment variables with OLD_
prefix.
- For save configuration change copy your current lock configuration
and prefix all environment keys with
OLD_
prefix, change basic environment variables with usage of new lock configuration. - Keep your application running with both configurations for a while.
- After all processes with unchanged configuration ends or dies,
remove all environment keys with
OLD_
prefix.
⚠ If your change of multiple environment variables is not atomic operation,
you should change variables in specific order. First create variables with OLD_
prefix,
OLD_LOCK_STORE
create as last one, second if you need, prepare specific variables for specific store,
third if you need, change LOCK_PREFIX
at last if you need, change LOCK_STORE
.
While you cleaning OLD_
prefix, remove OLD_LOCK_STORE
as first.
Is not recommended run application with old configuration for long time because locking with old store is less effective.
Usage
All versions of laravel-lock with dependencies
symfony/lock Version ^5.4.7|^6.0.7|^7.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/contracts Version ^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^8.0|^9.0|^10.0|^11.0|^12.0
simple-as-fuck/php-validator Version ^0.6.0|^0.7.0