From 08c95b254abd9f9b3f84bfdca7c3f8a88917cc90 Mon Sep 17 00:00:00 2001 From: Florian DE LA COMBLE Date: Sat, 27 Jul 2019 16:42:35 +0200 Subject: [PATCH] fclose($file) exception. It happens that fclose trigger an Exception because the resource is already closed. After investigation, it seems that the $file get closed in the putObject function (l. 274) when the garbage collector clean the memory. The change fix this issue. Here is the related issue on the aws sdk repo: https://github.com/aws/aws-sdk-php/issues/929 --- spaces.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spaces.php b/spaces.php index 8494bf4..f178eb7 100644 --- a/spaces.php +++ b/spaces.php @@ -289,7 +289,7 @@ class SpacesConnect { catch (\Exception $e) { $this->HandleAWSException($e); } finally { - if ($is_file) { + if (is_resource($file)) { fclose($file); } }