Skip to content

Use $this->getProjectDir() instead of dirname(__DIR__) #244

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
1 commit merged into from
Nov 10, 2017
Merged
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
10 changes: 5 additions & 5 deletions symfony/framework-bundle/3.3/src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class Kernel extends BaseKernel

public function getCacheDir()
{
return dirname(__DIR__).'/var/cache/'.$this->environment;
return $this->getProjectDir().'/var/cache/'.$this->environment;
}

public function getLogDir()
{
return dirname(__DIR__).'/var/log';
return $this->getProjectDir().'/var/log';
}

public function registerBundles()
{
$contents = require dirname(__DIR__).'/config/bundles.php';
$contents = require $this->getProjectDir().'/config/bundles.php';
foreach ($contents as $class => $envs) {
if (isset($envs['all']) || isset($envs[$this->environment])) {
yield new $class();
Expand All @@ -37,7 +37,7 @@ public function registerBundles()
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
{
$container->setParameter('container.autowiring.strict_mode', true);
$confDir = dirname(__DIR__).'/config';
$confDir = $this->getProjectDir().'/config';
$loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');
if (is_dir($confDir.'/packages/'.$this->environment)) {
$loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
Expand All @@ -48,7 +48,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa

protected function configureRoutes(RouteCollectionBuilder $routes)
{
$confDir = dirname(__DIR__).'/config';
$confDir = $this->getProjectDir().'/config';
if (is_dir($confDir.'/routes/')) {
$routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');
}
Expand Down