Skip to content

Commit

Permalink
Allow user to set the project dir
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tdutrion committed Mar 22, 2019
1 parent 7e5dfcf commit c40017d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Symfony/Component/HttpKernel/Kernel.php
Expand Up @@ -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()
Expand Down

0 comments on commit c40017d

Please sign in to comment.