Php Lock Lock Versions Save

Lock library to provide serialized execution of PHP code.

v2.2.1

2 years ago
  • Support psr/log versions 1, 2 and 3. Thanks @athos-ribeiro and @peldax.

v2.2

3 years ago
  • Support LZF compression on Redis connections (#32)
  • Redlock token is now in hexadecimal for easier debugging (#41)
  • Various changes such as adding phpstan, upgrading to a more recent version of PHPUnit, adding PHPCS etc.
  • Add PHP 8.0 support (#45)

Thanks everyone who contributed: @mvorisek and @TheLevti.

v2.1

5 years ago
  • Add the ability to get the code execution result or exception after a LockReleaseException. Thanks @Furgas for implementing the feature.

v2.0

5 years ago
  • PHP >= 7.1 only release. Thanks @TheLevti for assisting.
  • This version adds type hints to arguments and return types to methods. If you have your own implementations of the Mutex class, you might need to update it slightly.
  • The Memcache Mutex has been removed. You should use the Memcached mutex instead.
  • The Predis and PHPRedis mutexes have been updated to better follow the distlock from the Redis documentation.
  • A bug has been fixed in the Predis mutex where failing to release a lock could cause a fatal error if sentinel replication was used.
  • The return value of the callable passed to then() is now returned (#23). Thanks @TheLevti.
  • Various testing and CI improvements.

v1.4

5 years ago

Support for timeouts in flock calls. Uses pcntl when possible, busy waiting when not. #6.

v1.3

5 years ago
  • Adds a new lock backend based on PostgreSQL's advisory locks. Thanks to @korotovsky for suggesting this feature.
  • Spinlocks now use a back off factor of 1.5 instead of 2. This means that released locks will be detected earlier at the cost of performing more checks. This affects the various Redis and Memcached based lock backends.
  • Various testing and CI improvements.

v1.2

5 years ago
  • This adds a new MySQLMutex which uses GET_LOCK() as a back end.
  • Various improvements to tests.

v1.1

6 years ago
  • Library no longer uses rand() but instead uses random_int(). Now depends on paragonie/random_compat for PHP 5.6 compatibility (#7, #9, #10).
  • Fixed issue where locks could not be released if ext-redis was used with SERIALIZER_PHP or SERIALIZER_IGBINARY serialization option (#8, #14, provided by @maestroprog).
  • Spin locks will now time out at the exact time out time, instead of waiting beyond the timeout.
  • Distribution no longer ships with tests or tooling files.
  • composer.json was updated to require all development extensions too.
  • Now tested against PHP 7.2 and PHP 7.3 too.
  • HHVM support dropped.

BC breaks

  • The method seedRandom() has been removed from the RedisMutex class.