8000 Allow user to set the project dir · symfony/symfony@c40017d · GitHub
[go: up one dir, main page]

Skip to content

Commit c40017d

Browse files
committed
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.
1 parent 7e5dfcf commit c40017d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
8383
const END_OF_MAINTENANCE 8200 = '07/2019';
8484
const END_OF_LIFE = '01/2020';
8585

86-
public function __construct(string $environment, bool $debug)
86+
public function __construct(string $environment, bool $debug, string $projectDir = null)
8787
{
8888
$this->environment = $environment;
8989
$this->debug = $debug;
9090
$this->rootDir = $this->getRootDir(false);
9191
$this->name = $this->getName(false);
92+
$this->projectDir = $projectDir;
9293
}
9394

9495
public function __clone()

0 commit comments

Comments
 (0)
0