X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Ffilesystem%2FLockHandler.php;fp=vendor%2Fsymfony%2Ffilesystem%2FLockHandler.php;h=3496faae213363bd55e86228be0f10c0ba95f357;hp=67e6f8f522c1c2a96402524d18f67fcfd62cfcce;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae diff --git a/vendor/symfony/filesystem/LockHandler.php b/vendor/symfony/filesystem/LockHandler.php index 67e6f8f52..3496faae2 100644 --- a/vendor/symfony/filesystem/LockHandler.php +++ b/vendor/symfony/filesystem/LockHandler.php @@ -68,8 +68,12 @@ class LockHandler return true; } + $error = null; + // Silence error reporting - set_error_handler(function () {}); + set_error_handler(function ($errno, $msg) use (&$error) { + $error = $msg; + }); if (!$this->handle = fopen($this->file, 'r')) { if ($this->handle = fopen($this->file, 'x')) { @@ -82,8 +86,7 @@ class LockHandler restore_error_handler(); if (!$this->handle) { - $error = error_get_last(); - throw new IOException($error['message'], 0, null, $this->file); + throw new IOException($error, 0, null, $this->file); } // On Windows, even if PHP doc says the contrary, LOCK_NB works, see