From: Michael Wallner Date: Fri, 15 May 2015 07:48:31 +0000 (+0200) Subject: use additional file_exists checks X-Git-Tag: v4.0.0~8 X-Git-Url: https://git.m6w6.name/?p=pharext%2Fpharext;a=commitdiff_plain;h=1409885bcef1c517fc0bd23adb6a108aecb98afe use additional file_exists checks --- diff --git a/bin/pharext b/bin/pharext index a6b0d4a..1d9f2b0 100755 Binary files a/bin/pharext and b/bin/pharext differ diff --git a/src/pharext/Task/Cleanup.php b/src/pharext/Task/Cleanup.php index 54e64e9..14048a5 100644 --- a/src/pharext/Task/Cleanup.php +++ b/src/pharext/Task/Cleanup.php @@ -46,7 +46,7 @@ class Cleanup implements Task } } @rmdir($this->rm); - } else { + } elseif (file_exists($this->rm)) { @unlink($this->rm); } } diff --git a/src/pharext/Tempfile.php b/src/pharext/Tempfile.php index e720551..2ec6836 100644 --- a/src/pharext/Tempfile.php +++ b/src/pharext/Tempfile.php @@ -37,7 +37,9 @@ class Tempfile extends \SplFileInfo * Unlink the file */ public function __destruct() { - @unlink($this->getPathname()); + if (is_file($this->getPathname())) { + @unlink($this->getPathname()); + } } /**