Yaffs site version 1.1
[yaffs-website] / vendor / symfony / filesystem / LockHandler.php
index 67e6f8f522c1c2a96402524d18f67fcfd62cfcce..3496faae213363bd55e86228be0f10c0ba95f357 100644 (file)
@@ -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