Skip to content
Snippets Groups Projects
Commit 86cdf103 authored by Markus Klein's avatar Markus Klein Committed by Wouter Wolters
Browse files

[BUGFIX] Avoid non-blocking flock() calls Windows

Don't advertise the non-blocking capability of the
FileLockStrategy on Windows systems with PHP versions
below 5.5.23 or 5.6.7.
The non-blocking feature of flock() for Windows was
introduced with the aforementioned versions.

Resolves: #67916
Releases: master
Change-Id: I077f5fe39e237a689c3ad694f83a342b2cdb82c6
Reviewed-on: http://review.typo3.org/40926


Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
parent d26b0a55
No related merge requests found
......@@ -155,7 +155,14 @@ class FileLockStrategy implements LockingStrategyInterface {
// to protect files against other PHP scripts running in parallel threads of the same server instance!
return 0;
}
$capabilities = self::LOCK_CAPABILITY_EXCLUSIVE | self::LOCK_CAPABILITY_SHARED | self::LOCK_CAPABILITY_NOBLOCK;
$capabilities = self::LOCK_CAPABILITY_EXCLUSIVE | self::LOCK_CAPABILITY_SHARED;
if (TYPO3_OS !== 'WIN'
|| version_compare(PHP_VERSION, '5.5.22', '>') && version_compare(PHP_VERSION, '5.6.0', '<')
|| version_compare(PHP_VERSION, '5.6.6', '>')
) {
$capabilities |= self::LOCK_CAPABILITY_NOBLOCK;
}
return $capabilities;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment