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_rss.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'lib/lib_rss.php') diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 1ae99e6a1..01ec7fa98 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -724,26 +724,20 @@ function check_install_php(): array { ); } - /** * Check different data files and directories exist. - * * @return array of tested values. */ function check_install_files(): array { - return array( - // @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'), - // @phpstan-ignore-next-line - 'users' => USERS_PATH && touch(USERS_PATH . '/index.html'), - 'favicons' => touch(DATA_PATH . '/favicons/index.html'), - 'tokens' => touch(DATA_PATH . '/tokens/index.html'), - ); + return [ + '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'), + 'users' => is_dir(USERS_PATH) && touch(USERS_PATH . '/index.html'), + 'favicons' => is_dir(DATA_PATH) && touch(DATA_PATH . '/favicons/index.html'), + 'tokens' => is_dir(DATA_PATH) && touch(DATA_PATH . '/tokens/index.html'), + ]; } - /** * Check database is well-installed. * -- cgit v1.2.3