[Lock] use 'r+' for fopen (fixes issue on Solaris)
This commit is contained in:
parent
ff0de67519
commit
9c9ae7d9c9
@ -79,12 +79,12 @@ class FlockStore implements StoreInterface
|
||||
|
||||
// Silence error reporting
|
||||
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
|
||||
if (!$handle = fopen($fileName, 'r')) {
|
||||
if (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
|
||||
if ($handle = fopen($fileName, 'x')) {
|
||||
chmod($fileName, 0444);
|
||||
} elseif (!$handle = fopen($fileName, 'r')) {
|
||||
} elseif (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
|
||||
usleep(100); // Give some time for chmod() to complete
|
||||
$handle = fopen($fileName, 'r');
|
||||
$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r');
|
||||
}
|
||||
}
|
||||
restore_error_handler();
|
||||
|
Reference in New Issue
Block a user