From 0292b2f1f3a8cba3179467bba6c6af6bd0e97453 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 28 May 2023 18:03:34 +0200 Subject: Improve Dev Container (#5423) * Improve Dev Container PHPStan was failing in Dev Container * Update Docker to Alpine Linux 3.18 * New DATA_PATH environment variable * README --- lib/lib_install.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/lib_install.php') diff --git a/lib/lib_install.php b/lib/lib_install.php index 780115b63..80af02d4f 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -40,15 +40,11 @@ function checkRequirements(string $dbType = ''): array { $xml = function_exists('xml_parser_create'); $json = function_exists('json_encode'); $mbstring = extension_loaded('mbstring'); - // @phpstan-ignore-next-line - $data = DATA_PATH != '' && touch(DATA_PATH . '/index.html'); // is_writable() is not reliable for a folder on NFS - // @phpstan-ignore-next-line - $cache = CACHE_PATH != '' && touch(CACHE_PATH . '/index.html'); - $tmp = TMP_PATH != '' && is_writable(TMP_PATH); - // @phpstan-ignore-next-line - $users = USERS_PATH != '' && touch(USERS_PATH . '/index.html'); - // @phpstan-ignore-next-line - $favicons = DATA_PATH != '' && touch(DATA_PATH . '/favicons/index.html'); + $data = is_dir(DATA_PATH) && touch(DATA_PATH . '/index.html'); // is_writable() is not reliable for a folder on NFS + $cache = is_dir(CACHE_PATH) && touch(CACHE_PATH . '/index.html'); + $tmp = is_dir(TMP_PATH) && is_writable(TMP_PATH); + $users = is_dir(USERS_PATH) && touch(USERS_PATH . '/index.html'); + $favicons = is_dir(DATA_PATH) && touch(DATA_PATH . '/favicons/index.html'); return array( 'php' => $php ? 'ok' : 'ko', -- cgit v1.2.3