Skip to content

Commit afa0859

Browse files
committed
[HttpKernel] Introduce KernelInterface::getProjectDir()
This reverts commit 704867986d147c6ca2d326d796806a9fb4124bc6, reversing changes made to 557f85d1b38468c06c32215e9bcb6a0444182c59.
1 parent 8e522a8 commit afa0859

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Command/AboutCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
6060

6161
/** @var KernelInterface $kernel */
6262
$kernel = $this->getApplication()->getKernel();
63-
$projectDir = $kernel->getContainer()->getParameter('kernel.project_dir');
6463

6564
$rows = array(
6665
array('<info>Symfony</>'),
@@ -75,8 +74,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
7574
array('Environment', $kernel->getEnvironment()),
7675
array('Debug', $kernel->isDebug() ? 'true' : 'false'),
7776
array('Charset', $kernel->getCharset()),
78-
array('Cache directory', self::formatPath($kernel->getCacheDir(), $projectDir).' (<comment>'.self::formatFileSize($kernel->getCacheDir()).'</>)'),
79-
array('Log directory', self::formatPath($kernel->getLogDir(), $projectDir).' (<comment>'.self::formatFileSize($kernel->getLogDir()).'</>)'),
77+
array('Cache directory', self::formatPath($kernel->getCacheDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getCacheDir()).'</>)'),
78+
array('Log directory', self::formatPath($kernel->getLogDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getLogDir()).'</>)'),
8079
new TableSeparator(),
8180
array('<info>PHP</>'),
8281
new TableSeparator(),

Command/AssetsInstallCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\Filesystem\Filesystem;
2323
use Symfony\Component\Finder\Finder;
2424
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
25+
use Symfony\Component\HttpKernel\KernelInterface;
2526

2627
/**
2728
* Command that places bundle web assets into a given directory.
@@ -89,11 +90,12 @@ protected function configure()
8990
*/
9091
protected function execute(InputInterface $input, OutputInterface $output)
9192
{
93+
/** @var KernelInterface $kernel */
9294
$kernel = $this->getApplication()->getKernel();
9395
$targetArg = rtrim($input->getArgument('target'), '/');
9496

9597
if (!is_dir($targetArg)) {
96-
$targetArg = $kernel->getContainer()->getParameter('kernel.project_dir').'/'.$targetArg;
98+
$targetArg = $kernel->getProjectDir().'/'.$targetArg;
9799

98100
if (!is_dir($targetArg)) {
99101
throw new InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));

0 commit comments

Comments
 (0)