From c70a7efd155a30c41e5b82cc1776344b3cf40784 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 2 Mar 2026 20:11:39 +0100 Subject: [PATCH] Optimized Composer handling --- .devtools/install_dependencies.bat | 1 + .devtools/update_dependencies.bat | 1 + app.php | 5 ++--- helpers/ConfigurationValidator.php | 4 +++- helpers/PrerequisiteChecker.php | 6 ++++-- public/index.php | 4 ++-- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.devtools/install_dependencies.bat b/.devtools/install_dependencies.bat index 63923597..a319299d 100644 --- a/.devtools/install_dependencies.bat +++ b/.devtools/install_dependencies.bat @@ -1,4 +1,5 @@ pushd .. +set COMPOSER_FUND=0 call composer install call yarn install popd diff --git a/.devtools/update_dependencies.bat b/.devtools/update_dependencies.bat index 22e05ea7..7f642d01 100644 --- a/.devtools/update_dependencies.bat +++ b/.devtools/update_dependencies.bat @@ -1,4 +1,5 @@ pushd .. +set COMPOSER_FUND=0 call composer update call yarn upgrade popd diff --git a/app.php b/app.php index 9cdd14e5..5f1280be 100644 --- a/app.php +++ b/app.php @@ -14,7 +14,6 @@ require_once __DIR__ . '/packages/autoload.php'; // Load config files require_once GROCY_DATAPATH . '/config.php'; require_once __DIR__ . '/config-dist.php'; // For not in own config defined values we use the default ones -require_once __DIR__ . '/helpers/ConfigurationValidator.php'; // Error reporting definitions if (GROCY_MODE === 'dev') @@ -44,9 +43,9 @@ if (GROCY_DISABLE_AUTH === true) // Check if any invalid entries in config.php have been made try { - (new ConfigurationValidator())->validateConfig(); + (new Grocy\Helpers\ConfigurationValidator())->validateConfig(); } -catch (EInvalidConfig $ex) +catch (\Grocy\Helpers\EInvalidConfig $ex) { exit('Invalid setting in config.php: ' . $ex->getMessage()); } diff --git a/helpers/ConfigurationValidator.php b/helpers/ConfigurationValidator.php index c507867e..1a1dbf8b 100644 --- a/helpers/ConfigurationValidator.php +++ b/helpers/ConfigurationValidator.php @@ -1,6 +1,8 @@ query('select sqlite_version()')->fetch()[0]; } } diff --git a/public/index.php b/public/index.php index 0aa8289f..0fd46ce9 100644 --- a/public/index.php +++ b/public/index.php @@ -35,9 +35,9 @@ require_once __DIR__ . '/../helpers/PrerequisiteChecker.php'; try { - (new PrerequisiteChecker())->checkRequirements(); + (new Grocy\Helpers\PrerequisiteChecker())->checkRequirements(); } -catch (ERequirementNotMet $ex) +catch (Grocy\Helpers\ERequirementNotMet $ex) { exit('Unable to run Grocy: ' . $ex->getMessage()); }