This commit is contained in:
2026-03-04 23:07:20 +01:00
parent 70a475c36e
commit ab41951cf3
3 changed files with 24 additions and 1 deletions

View File

@@ -25,7 +25,21 @@ final class App
$this->flash = new Flash($this->session);
$this->pdo = Database::createPdo($config);
$this->basePdo = Database::createBasePdo($config);
$this->modules = new ModuleManager($this->basePdo, __DIR__ . '/../../modules');
$modulesPath = $this->config->modulesPath;
if ($modulesPath === '' || !is_dir($modulesPath)) {
$candidates = [
__DIR__ . '/../../modules',
__DIR__ . '/../modules',
dirname(__DIR__, 3) . '/modules',
];
foreach ($candidates as $candidate) {
if (is_dir($candidate)) {
$modulesPath = $candidate;
break;
}
}
}
$this->modules = new ModuleManager($this->basePdo, $modulesPath);
$this->modules->bootEnabled();
}