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 ..
set COMPOSER_FUND=0
call composer install
call yarn install
popd

View File

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

View File

@ -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());
}

View File

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

View File

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

View File

@ -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());
}