Skip to content

Releases: php-lock/lock

3.1.1

Choose a tag to compare

@mvorisek mvorisek released this 19 Feb 23:06
3e64b5e

Other changes

  • Add PHP 8.5 support (#83)

Full Changelog: 3.1.0...3.1.1

Upgrading notes

For upgrading from 2.x version see 3.0.0 release notes.

3.1.0

Choose a tag to compare

@mvorisek mvorisek released this 28 Jul 09:37
03f890a

Other changes

  • Add acquire timeout support to PostgreSQLMutex (#80)

Full Changelog: 3.0.2...3.1.0

Upgrading notes

For upgrading from 2.x version see 3.0.0 release notes.

3.0.2

Choose a tag to compare

@mvorisek mvorisek released this 17 May 21:26
9abe6ed

Other changes

  • Make AbstractLockMutex and Loop classes non-internal (#79)

Full changelog: 3.0.1...3.0.2

Upgrading notes

For upgrading from 2.x version see 3.0.0 release notes.

3.0.1

Choose a tag to compare

@mvorisek mvorisek released this 17 Dec 01:44
1dcf32d

Other changes

  • Add PHP 8.4 support (#58)

Full changelog: 3.0.0...3.0.1

Upgrading notes

For upgrading from 2.x version see 3.0.0 release notes.

3.0.0

Choose a tag to compare

@mvorisek mvorisek released this 15 Dec 14:52

Major features - renamed namespace

  • Rename namespace to PascalCase (#65)

Rename all FQCN uses from camelCase to PascalCase like malkusch\lock\mutex\Mutex to Malkusch\Lock\Mutex\Mutex.

Major features - renamed namespace

  • Merge Redis mutex implementations into single RedisMutex class (#69)
  • Introduce DistributedMutex class (#75)

In 2.x version, there were two PHPRedisMutex and PredisMutex classes. They were almost a duplicate of each other and both have implemented RedLock distributed lock when more than 1 Redis client instance was passed to the constructor.

Newly, in 3.x version, both class were unified into one RedisMutex class supporting both PHP redis and Predis clients. In addition, the constructor newly accepts only single Redis client instance.

When distributed lock is wanted, use new DistributedMutex class which newly accepts any AbstractSpinlockMutex class which is currently implemented by RedisMutex and MemcachedMutex. This change allows you to create distributed lock across different backends.

Major features - other

  • Introduce AbstractSpinlockWithTokenMutex class (#72)
  • Add fail callback support in DoubleCheckedLocking::then() method (#76)

Newly we strictly distinguish between:
- "acquire timeout" (timeout before the library give up trying to acquire a lock for your code)
- and "expire timeout" (timeout after the lock expires on the, possibly remote, store).

Breaking changes

  • Unify lock/unlock methods visibility (#62)
  • Prefix MySQL and PostgreSQL mutex name (#63, #64)
  • Remove CASMutex class (#67)
  • Improve abstract mutex classes naming (#68)
  • Rename TimeoutException to LockAcquireTimeoutException (#70)
  • Remove TransactionalMutex class (#73)
  • Rename NoMutex class to NullMutex (#74)

Other changes

  • Internal LockUtil class was added to deduplicate the code (70fd6d9)
  • Fix float to int casting and improve timeout names (#71)
  • Improve distributed locking (#77)
  • Fix pcntl_signal() restore when pcntl_alarm() is set (4fe9681)

Full changelog: 2.3.0...3.0.0

2.3.0

Choose a tag to compare

@mvorisek mvorisek released this 05 Dec 23:15

Major features

  • Add support for fractional seconds timeout (#55)

Other changes

  • Drop PHP 7.2 and PHP 7.3 support (b10b0a0)
  • Emit exceptions without "." at the end (515250e)
  • Improve RedisMutex token randomness (a98afa2)

Full changelog: 2.2.1...2.3.0

Release 2.2.1

Choose a tag to compare

@willemstuursma willemstuursma released this 26 Apr 09:59
63c1b26

Release 2.2

Choose a tag to compare

@willemstuursma willemstuursma released this 07 Mar 19:51
c3ee9d7
  • 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.

Release 2.1

Choose a tag to compare

@willemstuursma willemstuursma released this 12 Dec 19:59
093f389
  • Add the ability to get the code execution result or exception after a LockReleaseException. Thanks @Furgas for implementing the feature.

Release 2.0

Choose a tag to compare

@willemstuursma willemstuursma released this 08 Nov 21:43
5078c36
  • 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.