Skip to content

Commit

Permalink
Replace Kernel loadCommonGlobalConfig() call with a simple boot()
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Dec 18, 2024
1 parent 5449e41 commit 6975a17
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 17 deletions.
6 changes: 0 additions & 6 deletions .phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -2437,12 +2437,6 @@
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Console/Application.php',
];
$ignoreErrors[] = [
'message' => '#^Property Glpi\\\\Console\\\\Application\\:\\:\\$error_handler is unused\\.$#',
'identifier' => 'property.unused',
'count' => 1,
'path' => __DIR__ . '/src/Glpi/Console/Application.php',
];
$ignoreErrors[] = [
'message' => '#^Strict comparison using \\!\\=\\= between null and \'development\' will always evaluate to true\\.$#',
'identifier' => 'notIdentical.alwaysTrue',
Expand Down
2 changes: 1 addition & 1 deletion front/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion phpunit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new Kernel('testing');
$kernel->loadCommonGlobalConfig();
$kernel->boot();

if (!file_exists(GLPI_CONFIG_DIR . '/config_db.php')) {
echo("\nConfiguration file for tests not found\n\nrun: php bin/console database:install --env=testing ...\n\n");
Expand Down
2 changes: 1 addition & 1 deletion tests/bin/test-updated-data
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
require_once dirname(__DIR__, 2) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel('testing');
$kernel->loadCommonGlobalConfig();
$kernel->boot();

$command = new \Glpi\Tests\Command\TestUpdatedDataCommand();

Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
require_once dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new Kernel('testing');
$kernel->loadCommonGlobalConfig();
$kernel->boot();

if (!file_exists(GLPI_CONFIG_DIR . '/config_db.php')) {
echo("\nConfiguration file for tests not found\n\nrun: php bin/console database:install --env=testing ...\n\n");
Expand Down
2 changes: 1 addition & 1 deletion tools/cachebench.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();

define('PER_LEVEL', 8);
define('COUNT', 1024);
Expand Down
2 changes: 1 addition & 1 deletion tools/fake_metrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();

$printers_id = false;
$networkports_id = false;
Expand Down
2 changes: 1 addition & 1 deletion tools/fk_generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();

$DB->query("SET FOREIGN_KEY_CHECKS = '0';");
$result = $DB->list_tables();
Expand Down
2 changes: 1 addition & 1 deletion tools/getsearchoptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();

if (isset($_SERVER['argv'])) {
for ($i = 1; $i < $_SERVER['argc']; $i++) {
Expand Down
2 changes: 1 addition & 1 deletion tools/inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new Kernel('testing');
$kernel->loadCommonGlobalConfig();
$kernel->boot();

$conf = new Conf();
if ($conf->enabled_inventory != 1) {
Expand Down
2 changes: 1 addition & 1 deletion tools/testmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();

if (isset($_SERVER['argc'])) {
for ($i = 1; $i < $_SERVER['argc']; $i++) {
Expand Down
2 changes: 1 addition & 1 deletion tools/update_registered_ids.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
require dirname(__DIR__) . '/vendor/autoload.php';

$kernel = new \Glpi\Kernel\Kernel();
$kernel->loadCommonGlobalConfig();
$kernel->boot();

$registeredid = new RegisteredID();
$manufacturer = new Manufacturer();
Expand Down

0 comments on commit 6975a17

Please sign in to comment.