rebuild to module
This commit is contained in:
@@ -13,6 +13,8 @@ final class App
|
||||
private I18n $i18n;
|
||||
private Flash $flash;
|
||||
private ?\PDO $pdo;
|
||||
private ?\PDO $basePdo;
|
||||
private ModuleManager $modules;
|
||||
|
||||
private function __construct(private Config $config)
|
||||
{
|
||||
@@ -22,6 +24,9 @@ final class App
|
||||
$this->i18n = new I18n($config, 'en');
|
||||
$this->flash = new Flash($this->session);
|
||||
$this->pdo = Database::createPdo($config);
|
||||
$this->basePdo = Database::createBasePdo($config);
|
||||
$this->modules = new ModuleManager($this->basePdo, __DIR__ . '/../../modules');
|
||||
$this->modules->bootEnabled();
|
||||
}
|
||||
|
||||
public static function init(Config $config): self
|
||||
@@ -47,4 +52,6 @@ final class App
|
||||
public function i18n(): I18n { return $this->i18n; }
|
||||
public function flash(): Flash { return $this->flash; }
|
||||
public function pdo(): ?\PDO { return $this->pdo; }
|
||||
public function basePdo(): ?\PDO { return $this->basePdo; }
|
||||
public function modules(): ModuleManager { return $this->modules; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user