mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 15:46:37 +03:00
Use $this->getProjectDir() instead of dirname(__DIR__)
This commit is contained in:
@@ -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();
|
||||
@@ -37,7 +37,7 @@ class Kernel extends BaseKernel
|
||||
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');
|
||||
@@ -48,7 +48,7 @@ class Kernel extends BaseKernel
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user