Skip to content

Commit

Permalink
fix wrong global bootstrap loader
Browse files Browse the repository at this point in the history
  • Loading branch information
boxblinkracer committed Dec 19, 2024
1 parent da53fa9 commit f79e494
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/AppManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,18 @@ private static function loadBootstrap(string $configPath): void

$rootConfigDir = dirname($configPath) . '/';

$bootstrap = (string)($xml->attributes()->bootstrap ?? '');
$bootstrap = (string)realpath($rootConfigDir . '/' . $bootstrap);
$bootstrapFile = (string)($xml->attributes()->bootstrap ?? '');

if (file_exists($bootstrap)) {
require_once $bootstrap;
} elseif (!file_exists($bootstrap)) {
throw new ConfigurationException('Bootstrap file not found: ' . $bootstrap);
if ($bootstrapFile === '') {
return;
}

$bootstrapFixedFilename = (string)realpath($rootConfigDir . '/' . $bootstrapFile);

if (file_exists($bootstrapFixedFilename)) {
require_once $bootstrapFixedFilename;
} elseif (!file_exists($bootstrapFixedFilename)) {
throw new ConfigurationException('Bootstrap file not found: ' . $bootstrapFixedFilename);
}
}
}

0 comments on commit f79e494

Please sign in to comment.