From c40017d63ca567dd357c58fb5662a25f66e7d800 Mon Sep 17 00:00:00 2001 From: tdutrion Date: Fri, 22 Mar 2019 19:14:40 +0100 Subject: [PATCH] Allow user to set the project dir Currently, the project directory is defined by the location of the composer.json file. That file is not required in production, which therefore breaks the method getProjectDir (who sends back null). This does not fix the behaviour, but allows the developer to pass the project dir as a parameter. --- src/Symfony/Component/HttpKernel/Kernel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 402e039144..cc726999eb 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -83,12 +83,13 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl const END_OF_MAINTENANCE = '07/2019'; const END_OF_LIFE = '01/2020'; - public function __construct(string $environment, bool $debug) + public function __construct(string $environment, bool $debug, string $projectDir = null) { $this->environment = $environment; $this->debug = $debug; $this->rootDir = $this->getRootDir(false); $this->name = $this->getName(false); + $this->projectDir = $projectDir; } public function __clone()