8000 [HttpKernel] Inherit projectDir in the temporary kernel by aschempp · Pull Request #22889 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] Inherit projectDir in the temporary kernel #22889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Set the projectDir in the temporary kernel
  • Loading branch information
aschempp committed May 24, 2017
commit 110d82e5db4a5979ca500f87d66e81a7841a3550
11 changes: 11 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
87BB
Original file line number Diff line numberDiff line change
Expand Up @@ -207,6 +207,12 @@ protected function getTempKernel(KernelInterface $parent, $namespace, $parentCla
$class = substr($parentClass, 0, -1).'_';
// the temp container class must be changed too
$containerClass = var_export(substr(get_class($parent->getContainer()), 0, -1).'_', true);

$projectDir = '';
if (method_exists($parent, 'getProjectDir')) {
$projectDir = var_export(realpath($parent->getProjectDir()), true);
}

$code = <<<EOF
<?php

Expand All @@ -228,6 +234,11 @@ public function getLogDir()
{
return $logDir;
}

public function getProjectDir()
{
return $projectDir;
}

protected function getContainerClass()
{
Expand Down
0