Optimized Composer handling

This commit is contained in:
Bernd Bestel 2026-03-02 20:11:39 +01:00
parent 1463a8d21b
commit c70a7efd15
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
6 changed files with 13 additions and 8 deletions

View File

@ -1,4 +1,5 @@
pushd .. pushd ..
set COMPOSER_FUND=0
call composer install call composer install
call yarn install call yarn install
popd popd

View File

@ -1,4 +1,5 @@
pushd .. pushd ..
set COMPOSER_FUND=0
call composer update call composer update
call yarn upgrade call yarn upgrade
popd popd

View File

@ -14,7 +14,6 @@ require_once __DIR__ . '/packages/autoload.php';
// Load config files // Load config files
require_once GROCY_DATAPATH . '/config.php'; 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__ . '/config-dist.php'; // For not in own config defined values we use the default ones
require_once __DIR__ . '/helpers/ConfigurationValidator.php';
// Error reporting definitions // Error reporting definitions
if (GROCY_MODE === 'dev') if (GROCY_MODE === 'dev')
@ -44,9 +43,9 @@ if (GROCY_DISABLE_AUTH === true)
// Check if any invalid entries in config.php have been made // Check if any invalid entries in config.php have been made
try 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()); exit('Invalid setting in config.php: ' . $ex->getMessage());
} }

View File

@ -1,6 +1,8 @@
<?php <?php
class EInvalidConfig extends Exception namespace Grocy\Helpers;
class EInvalidConfig extends \Exception
{ {
} }

View File

@ -1,6 +1,8 @@
<?php <?php
class ERequirementNotMet extends Exception namespace Grocy\Helpers;
class ERequirementNotMet extends \Exception
{ {
} }
@ -81,7 +83,7 @@ class PrerequisiteChecker
private function getSqlVersionAsString() private function getSqlVersionAsString()
{ {
$dbh = new PDO('sqlite::memory:'); $dbh = new \PDO('sqlite::memory:');
return $dbh->query('select sqlite_version()')->fetch()[0]; return $dbh->query('select sqlite_version()')->fetch()[0];
} }
} }

View File

@ -35,9 +35,9 @@ require_once __DIR__ . '/../helpers/PrerequisiteChecker.php';
try try
{ {
(new PrerequisiteChecker())->checkRequirements(); (new Grocy\Helpers\PrerequisiteChecker())->checkRequirements();
} }
catch (ERequirementNotMet $ex) catch (Grocy\Helpers\ERequirementNotMet $ex)
{ {
exit('Unable to run Grocy: ' . $ex->getMessage()); exit('Unable to run Grocy: ' . $ex->getMessage());
} }