diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-10-05 21:44:27 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-10-05 21:44:27 +0200 |
commit | 01842f99b65b06d2647470c3b867719e72dabde7 (patch) | |
tree | 6ee373d5df46cf1097b06fa37bcfb0dc9b09d811 /ratatoeskr/sys/Env.php | |
parent | 5e347e4efaa81c2108256dc927208cd55dc10baa (diff) | |
download | ratatoeskr-cms-01842f99b65b06d2647470c3b867719e72dabde7.tar.gz ratatoeskr-cms-01842f99b65b06d2647470c3b867719e72dabde7.tar.bz2 ratatoeskr-cms-01842f99b65b06d2647470c3b867719e72dabde7.zip |
Introduce some new database wrappers
This will allow us to avoid using globals and use the autoloader in the
future.
Diffstat (limited to 'ratatoeskr/sys/Env.php')
-rw-r--r-- | ratatoeskr/sys/Env.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ratatoeskr/sys/Env.php b/ratatoeskr/sys/Env.php index cfe1598..63d079d 100644 --- a/ratatoeskr/sys/Env.php +++ b/ratatoeskr/sys/Env.php @@ -34,4 +34,13 @@ class Env { return $this->lazy("textprocessors", [TextprocessorRepository::class, 'buildDefault']); } + + public function database(): Database + { + return $this->lazy("database", static function () { + global $config; + + return Database::fromConfig($config); + }); + } } |