b13 / distributed-locks

Adds a Redis Locking Strategy for TYPO3 frontend page generation, useful on distributed systems with NFS.
GNU General Public License v2.0
12 stars 8 forks source link

[QUESTION] Disable Extension on environments without redis on TYPO3 11 #14

Closed npoggenburg closed 2 years ago

npoggenburg commented 2 years ago

Hello fellow TYPO3 enthusiasts,

I have a question about the extension and TYPO3 11. Under TYPO3 11 all extensions are activated, which are in the composer.lock. When developing I have the following environments:

  1. dev: redis installed but not used.
  2. staging server: Redis not installed
  3. live server: Redis installed and used

This can lead to the following problems on the systems above:

  1. dev: the extension throws an error if no configuration is set. After setting the array keys, everything works.
    $GLOBALS['TYPO3_CONF_VARS']['SYS']['locking']['redis'] = [
    'hostname' => '',
    'database' => 0
    ];
  2. staging: the extension throws an error if no configuration is set. If a configuration is set, the extension throws an error that the redis class cannot be found.
  3. live: everything works

Is there a nice way to enable the extension under TYPO3 11 only on certain systems, or is this not provided?

Thank you so much for developing and maintaining this extension, best regards Nico <3

baschny commented 2 years ago

I just stumbled on this same issue and made a quick patch - which works for us right now. Feel free to test it @npoggenburg :

composer config repositories.cron git https://github.com/cron-eu/distributed-locks.git
composer require b13/distributed-locks:dev-14-disable-redis-locking

Maybe @bmack can take a look at it and integrate and release a new version with this option. Thanks for the cool work on it, B13!