aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-12-21 19:26:08 +0100
committerGravatar GitHub <noreply@github.com> 2025-12-21 19:26:08 +0100
commit1a3912f25a27c8d78aacbbee98f6056f4ad47f1a (patch)
tree90fe6bd955535aed22152fc3a41a51a4958f4d4d /app/Controllers
parent672411ca7053345634a63dd3eabed75baf93043f (diff)
Improve configuration checks (#8334)
Add a distinction between recommended and required extensions. Add check for recommended php-intl extension as follow-up of https://github.com/FreshRSS/FreshRSS/pull/8329#issuecomment-3677686581 Improve related checks such as ZIP. Reduce duplicated translations and tests.
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/updateController.php32
1 files changed, 7 insertions, 25 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 3adc96078..e29ce754d 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -342,38 +342,20 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
/**
* Check PHP and its extensions are well-installed.
*
- * @return array<string,bool> of tested values.
+ * @return array<string,'ok'|'ko'|'warn'> of tested values.
*/
private static function check_install_php(): array {
- $pdo_mysql = extension_loaded('pdo_mysql');
- $pdo_pgsql = extension_loaded('pdo_pgsql');
- $pdo_sqlite = extension_loaded('pdo_sqlite');
- return [
- 'php' => version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION) >= 0,
- 'curl' => extension_loaded('curl'),
- 'pdo' => $pdo_mysql || $pdo_sqlite || $pdo_pgsql,
- 'pcre' => extension_loaded('pcre'),
- 'ctype' => extension_loaded('ctype'),
- 'fileinfo' => extension_loaded('fileinfo'),
- 'dom' => class_exists('DOMDocument'),
- 'json' => extension_loaded('json'),
- 'mbstring' => extension_loaded('mbstring'),
- 'zip' => extension_loaded('zip'),
- ];
+ require_once LIB_PATH . '/lib_install.php';
+ return checkRequirements(FreshRSS_Context::systemConf()->db['type'] ?? '', checkPhp: true, checkFiles: false);
}
/**
* Check different data files and directories exist.
- * @return array<string,bool> of tested values.
+ * @return array<string,'ok'|'ko'|'warn'> of tested values.
*/
private static function check_install_files(): array {
- 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'),
- ];
+ require_once LIB_PATH . '/lib_install.php';
+ return checkRequirements(FreshRSS_Context::systemConf()->db['type'] ?? '', checkPhp: false, checkFiles: true);
}
/**
@@ -414,7 +396,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController {
* This action displays information about installation.
*/
public function checkInstallAction(): void {
- FreshRSS_View::prependTitle(_t('admin.check_install.title') . ' · ');
+ FreshRSS_View::prependTitle(_t('install.check._') . ' · ');
$this->view->status_php = self::check_install_php();
$this->view->status_files = self::check_install_files();