8000 use getProjectDir() when possible by xabbuh · Pull Request #22843 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

use getProjectDir() when possible #22843

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

Merged
merged 1 commit into from
May 23, 2017
Merged
Show file tree
Hide file tree
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
7 changes: 3 additions & 4 deletions src/Symfony/Bundle/FrameworkBundle/Command/AboutCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ protected function execute(InputInterface $input, OutputInterface $output)

/** @var $kernel KernelInterface */
$kernel = $this->getContainer()->get('kernel');
$baseDir = realpath($kernel->getRootDir().DIRECTORY_SEPARATOR.'..');

$io->table(array(), array(
array('<info>Symfony</>'),
Expand All @@ -62,9 +61,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
array('Environment', $kernel->getEnvironment()),
array('Debug', $kernel->isDebug() ? 'true' : 'false'),
array('Charset', $kernel->getCharset()),
array('Root directory', self::formatPath($kernel->getRootDir(), $baseDir)),
array('Cache directory', self::formatPath($kernel->getCacheDir(), $baseDir).' (<comment>'.self::formatFileSize($kernel->getCacheDir()).'</>)'),
array('Log directory', self::formatPath($kernel->getLogDir(), $baseDir).' (<comment>'.self::formatFileSize($kernel->getLogDir()).'</>)'),
array('Root directory', self::formatPath($kernel->getRootDir(), $kernel->getProjectDir())),
array('Cache directory', self::formatPath($kernel->getCacheDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getCacheDir()).'</>)'),
array('Log directory', self::formatPath($kernel->getLogDir(), $kernel->getProjectDir()).' (<comment>'.self::formatFileSize($kernel->getLogDir()).'</>)'),
new TableSeparator(),
array('<info>PHP</>'),
new TableSeparator(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$targetArg = rtrim($input->getArgument('target'), '/');

if (!is_dir($targetArg)) {
$appRoot = $this->getContainer()->getParameter('kernel.root_dir').'/..';

$targetArg = $appRoot.'/'.$targetArg;
$targetArg = $this->getContainer()->getParameter('kernel.project_dir').'/'.$targetArg;

if (!is_dir($targetArg)) {
throw new \InvalidArgumentException(sprintf('The target directory "%s" does not exist.', $input->getArgument('target')));
Expand Down
8000
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/WebServerBundle/Resources/config/webserver.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
<defaults public="false" />

<service id="web_server.command.server_run" class="Symfony\Bundle\WebServerBundle\Command\ServerRunCommand">
<argument>%kernel.root_dir%/../web</argument>
<argument>%kernel.project_dir%/web</argument>
<argument>%kernel.environment%</argument>
<tag name="console.command" />
</service>

<service id="web_server.command.server_start" class="Symfony\Bundle\WebServerBundle\Command\ServerStartCommand">
<argument>%kernel.root_dir%/../web</argument>
<argument>%kernel.project_dir%/web</argument>
<argument>%kernel.environment%</argument>
<tag name="console.command" />
</service>
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/WebServerBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=5.5.9",
"symfony/console": "~2.8.8|~3.0.8|~3.1.2|~3.2",
"symfony/http-kernel": "~2.8|~3.0",
"symfony/http-kernel": "~3.3",
"symfony/process": "~2.8|~3.0"
},
"autoload": {
Expand Down
0