use additional file_exists checks
authorMichael Wallner <mike@php.net>
Fri, 15 May 2015 07:48:31 +0000 (09:48 +0200)
committerMichael Wallner <mike@php.net>
Fri, 15 May 2015 07:48:31 +0000 (09:48 +0200)
bin/pharext
src/pharext/Task/Cleanup.php
src/pharext/Tempfile.php

index a6b0d4a7fe78400f52ea1eda2a0370b7d3fcf78c..1d9f2b0f94a8618855746a559250b7241dac11ed 100755 (executable)
Binary files a/bin/pharext and b/bin/pharext differ
index 54e64e9ea318508472b7cbd469bbe824a3a48db8..14048a52b60c6559863a5f6adc90181a431684a0 100644 (file)
@@ -46,7 +46,7 @@ class Cleanup implements Task
                                }
                        }
                        @rmdir($this->rm);
-               } else {
+               } elseif (file_exists($this->rm)) {
                        @unlink($this->rm);
                }
        }
index e7205519ea784869a58c821d132609091a4720c3..2ec68369adeacde9836240b0639d8121568facb2 100644 (file)
@@ -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());
+               }
        }
 
        /**