X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSystem.php;h=00bdcd455c50e495d5c78587b567e8f664becc76;hb=b9bb525fe91c176ada2323c2d628291a27594d59;hp=b31e611998af6fddfb305a2b44dd5aa46972a4f0;hpb=c4c80ed3cce6d11a4350b62ee055da9160a2fdfd;p=friendica.git diff --git a/src/Core/System.php b/src/Core/System.php index b31e611998..00bdcd455c 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -523,19 +523,18 @@ class System * Checks if a given directory is usable for the system * * @param $directory - * @param bool $check_writable * * @return boolean the directory is usable */ - private static function isDirectoryUsable($directory, $check_writable = true) + private static function isDirectoryUsable(string $directory): bool { - if ($directory == '') { + if (empty($directory)) { Logger::warning('Directory is empty. This shouldn\'t happen.'); return false; } if (!file_exists($directory)) { - Logger::warning('Path does not exist', ['directory' => $directory, 'user' => static::getUser()]); + Logger::info('Path does not exist', ['directory' => $directory, 'user' => static::getUser()]); return false; } @@ -549,7 +548,7 @@ class System return false; } - if ($check_writable && !is_writable($directory)) { + if (!is_writable($directory)) { Logger::warning('Path is not writable', ['directory' => $directory, 'user' => static::getUser()]); return false; } @@ -601,7 +600,7 @@ class System $new_temppath = $temppath . "/" . DI::baseUrl()->getHost(); if (!is_dir($new_temppath)) { /// @TODO There is a mkdir()+chmod() upwards, maybe generalize this (+ configurable) into a function/method? - mkdir($new_temppath); + @mkdir($new_temppath); } if (self::isDirectoryUsable($new_temppath)) {