bigstep / lock-mysql-innodb
Centralised blocking or non-blocking locks using MySQL's InnoDB transaction features.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 3
Open Issues: 1
pkg:composer/bigstep/lock-mysql-innodb
Requires
- php: ^7.2
This package is not auto-updated.
Last update: 2025-12-20 13:50:30 UTC
README
Centralised blocking or non-blocking locks using MySQL's InnoDB transaction features.
Requirements
- PHP >= 7.2.0
Installation
If you are using composer, run the following command in the root directory of your project.
composer require bigstep/lock-mysql-innodb
Usage
You will need a config with the following MySQL parameters:
$array = [
"databaseName" => "databaseName",
"port" => 3306,
"host" => "localhost",
"username" => "username",
"password" => "password"
];
Then you can instantiate the MySQL InnoDB Driver and start acquiring locks.
$client = new LockInnoDB\Engines\MySQLInnoDB\Driver(/*\LockInnoDB\Engines\DriverBase*/ null, $array);
$client->acquire("Lock1", true);
$client->release("Lock1");