diff --git a/extension/Classes/Core/Helper/HelperFile.php b/extension/Classes/Core/Helper/HelperFile.php index 78c7103c734db4fb0cc37912cedee69dd085182a..bc0cb0cce3f479de5463f06162e27829a3ebc3d1 100644 --- a/extension/Classes/Core/Helper/HelperFile.php +++ b/extension/Classes/Core/Helper/HelperFile.php @@ -247,9 +247,9 @@ class HelperFile { public static function chmod($pathFileName, $mode = false) { if ($mode !== false) { - if (false === chmod($pathFileName, $mode)) { + if (false === @chmod($pathFileName, $mode)) { throw new \UserFormException( - json_encode([ERROR_MESSAGE_TO_USER => 'Failed: chmod', ERROR_MESSAGE_TO_DEVELOPER => "Failed: chmod $mode '$pathFileName'"]), + json_encode([ERROR_MESSAGE_TO_USER => 'Failed: chmod', ERROR_MESSAGE_TO_DEVELOPER => self::errorGetLastAsString()]), ERROR_IO_CHMOD); } } @@ -277,7 +277,7 @@ class HelperFile { */ public static function chdir($cwd) { - if (false === chdir($cwd)) { + if (false === @chdir($cwd)) { $msg = self::errorGetLastAsString() . " - chdir($cwd)"; throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'chdir failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_CHDIR); } @@ -300,7 +300,7 @@ class HelperFile { Logger::logMessageWithPrefix("Unlink: $filename", $logFilename); } - if (false === unlink($filename)) { + if (false === @unlink($filename)) { $msg = self::errorGetLastAsString() . " - unlink($filename)"; throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'unlink failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_UNLINK); } @@ -317,7 +317,7 @@ class HelperFile { */ public static function rmdir($tempDir) { - if (false === rmdir($tempDir)) { + if (false === @rmdir($tempDir)) { $msg = self::errorGetLastAsString() . " - rmdir($tempDir)"; throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'rmdir failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_RMDIR); } @@ -335,7 +335,7 @@ class HelperFile { */ public static function rename($oldname, $newname) { - if (false === rename($oldname, $newname)) { + if (false === @rename($oldname, $newname)) { $msg = self::errorGetLastAsString() . " - rename($oldname ,$newname)"; throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'unlink failed', ERROR_MESSAGE_TO_DEVELOPER => $msg]), ERROR_IO_RENAME); } @@ -358,7 +358,7 @@ class HelperFile { touch($dest); } - if (false === copy($source, $dest)) { + if (false === @copy($source, $dest)) { if (!is_readable($source)) { throw new \UserFormException(json_encode([ERROR_MESSAGE_TO_USER => 'copy failed', ERROR_MESSAGE_TO_DEVELOPER => "Can't read file '$source'"]), ERROR_IO_READ_FILE);