Download the PHP package b13/distributed-locks without Composer

On this page you can find all versions of the php package b13/distributed-locks. 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 distributed-locks

Distributed Redis Locker for TYPO3 Locking Mechanism

TYPO3 has three built-in Locking Strategies, that are chosen at runtime which fits best for the current system setup.

However, when dealing with a multi-tier system and a shared file system with multiple frontend nodes with a NFS filesystem, it is especially helpful to use a better suitable format. Redis is our weapon of choice for handling multi-node scenarios, and works just fine with TYPO3 and Caching.

This extension provides a Redis Locking mechanism to store the locks in a (shared) Redis database.

Requirements

This extension is available for TYPO3 v8+ LTS, and requires the PHP package php-redis as well as a Redis server.

Installation

Install this extension via composer composer require b13/distributed-locks or extensions.typo3.org / Extension Manager, and activate it in the Extension Manager.

Now add the following lines to your LocalConfiguration / AdditionalConfiguration to activate Redis Locking.

$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['redis'] = [
    'hostname' => '127.0.0.1',
    'database' => 12
];

Other options:

'ttl' (numeric, default is 30sec)
'port' (numeric, default is 6379)
'password' (contains the password, necessary for secure authentication if required by redis)
'priority' (numeric, default is 95) - Set priority for this locking strategy. See LockingApi documentation.

Disabling it in certain contextes

If you have different TYPO3_CONTEXT or environments and you want to switch off the complete redis strategy (i.e. in your staging machine), you can set this in your LocalConfiguration / AdditionalConfiguration:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['redis']['disabled'] = true;

Future Development

Should be switched to symfony/lock to allow distributed redis services and other lockers.

Credits & Background

Inspiration was taken from the now unmaintained extension "redis_lock_strategy" which we used several times, however with some drawbacks:

Thanks to Alexander Miehe for the initial extension and the conceptual work.

Sharing our expertise

Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.


All versions of distributed-locks with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0 | ^8.0
ext-redis Version *
typo3/cms-core Version ^8.7 || ^9.5 || ^10.0 || ^11.0 || ^12.0
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 b13/distributed-locks contains the following files

Loading the files please wait ....