Skip to content

Commit 2bb4ff0

Browse files
committed
Use $this->getProjectDir() instead of dirname(__DIR__)
1 parent 5f0d506 commit 2bb4ff0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

symfony/framework-bundle/3.3/src/Kernel.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ class Kernel extends BaseKernel
1616

1717
public function getCacheDir()
1818
{
19-
return dirname(__DIR__).'/var/cache/'.$this->environment;
19+
return $this->getProjectDir().'/var/cache/'.$this->environment;
2020
}
2121

2222
public function getLogDir()
2323
{
24-
return dirname(__DIR__).'/var/log';
24+
return $this->getProjectDir().'/var/log';
2525
}
2626

2727
public function registerBundles()
2828
{
29-
$contents = require dirname(__DIR__).'/config/bundles.php';
29+
$contents = require $this->getProjectDir().'/config/bundles.php';
3030
foreach ($contents as $class => $envs) {
3131
if (isset($envs['all']) || isset($envs[$this->environment])) {
3232
yield new $class();
@@ -37,7 +37,7 @@ public function registerBundles()
3737
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
3838
{
3939
$container->setParameter('container.autowiring.strict_mode', true);
40-
$confDir = dirname(__DIR__).'/config';
40+
$confDir = $this->getProjectDir().'/config';
4141
$loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');
4242
if (is_dir($confDir.'/packages/'.$this->environment)) {
4343
$loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
@@ -48,7 +48,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
4848

4949
protected function configureRoutes(RouteCollectionBuilder $routes)
5050
{
51-
$confDir = dirname(__DIR__).'/config';
51+
$confDir = $this->getProjectDir().'/config';
5252
if (is_dir($confDir.'/routes/')) {
5353
$routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');
5454
}

0 commit comments

Comments
 (0)