diff options
Diffstat (limited to 'lib/classes/DIContainer.php')
| -rw-r--r-- | lib/classes/DIContainer.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/classes/DIContainer.php b/lib/classes/DIContainer.php index 9f0721b..c3d9b82 100644 --- a/lib/classes/DIContainer.php +++ b/lib/classes/DIContainer.php @@ -17,7 +17,7 @@ class DIContainer /** * Get the globally available instance of the container. * - * @return static + * @return ContainerInterface */ public static function getInstance() { @@ -47,9 +47,11 @@ class DIContainer { $builder = new ContainerBuilder(); if (\Studip\ENV == 'production') { - $builder->enableCompilation($GLOBALS['TMP_PATH']); + $builder->enableCompilation( + self::getCompilationPath(), + self::getCompilationClass() + ); } - $builder->ignorePhpDocErrors(true); $builder->addDefinitions('lib/bootstrap-definitions.php'); $jsonapiSettings = require 'lib/classes/JsonApi/settings.php'; @@ -60,4 +62,14 @@ class DIContainer return $builder; } + + public static function getCompilationPath(): string + { + return $GLOBALS['TMP_PATH']; + } + + public static function getCompilationClass(): string + { + return 'CompiledContainer'; + } } |
