Skip to content

Commit 9de60c6

Browse files
committed
feature #568 Replaced kernel.root_dir by kernel.project_dir (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Replaced kernel.root_dir by kernel.project_dir As explained in https://symfony.com/blog/new-in-symfony-3-3-a-simpler-way-to-get-the-project-root-directory Commits ------- 9baccbe Replaced kernel.root_dir by kernel.project_dir
2 parents ac188e9 + 9baccbe commit 9de60c6

File tree

6 files changed

+4
-11
lines changed

6 files changed

+4
-11
lines changed

app/config/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ framework:
3333
translator: { fallback: '%locale%' }
3434
secret: '%env(SYMFONY_SECRET)%'
3535
router:
36-
resource: '%kernel.root_dir%/config/routing.yml'
36+
resource: '%kernel.project_dir%/app/config/routing.yml'
3737
strict_requirements: ~
3838
form: ~
3939
csrf_protection: ~

app/config/config_dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ imports:
33

44
framework:
55
router:
6-
resource: "%kernel.root_dir%/config/routing_dev.yml"
6+
resource: "%kernel.project_dir%/app/config/routing_dev.yml"
77
strict_requirements: true
88
profiler: { only_exceptions: false }
99

app/config/config_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ web_profiler:
2121
# In this case we just need to define a different path for the application database.
2222
doctrine:
2323
dbal:
24-
path: "%kernel.root_dir%/../var/data/blog_test.sqlite"
24+
path: "%kernel.project_dir%/var/data/blog_test.sqlite"
2525

2626
# this configuration simplifies testing URLs protected by the security mechanism
2727
# See https://symfony.com/doc/current/cookbook/testing/http_authentication.html

app/config/parameters.yml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ parameters:
1717
# this demo application uses an embedded SQLite database to simplify setup.
1818
# in a real Symfony application you probably will use a MySQL or PostgreSQL database
1919
# the path must be relative or else it will not work on Windows
20-
env(DATABASE_URL): 'sqlite:///%kernel.root_dir%/../var/data/blog.sqlite'
20+
env(DATABASE_URL): 'sqlite:///%kernel.project_dir%/var/data/blog.sqlite'
2121

2222
# Uncomment this line to use a MySQL database instead of SQLite (and remove
2323
# the "doctrine" section from config_dev.yml regarding SQLite):

src/CodeExplorerBundle/Resources/config/services.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ services:
22
code_explorer.twig.source_code_extension:
33
public: false
44
class: CodeExplorerBundle\Twig\SourceCodeExtension
5-
arguments: ['%kernel.root_dir%']
65
tags:
76
- { name: twig.extension }
87

src/CodeExplorerBundle/Twig/SourceCodeExtension.php

-6
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@
2323
class SourceCodeExtension extends \Twig_Extension
2424
{
2525
private $controller;
26-
private $kernelRootDir;
27-
28-
public function __construct($kernelRootDir)
29-
{
30-
$this->kernelRootDir = $kernelRootDir;
31-
}
3226

3327
public function setController($controller)
3428
{

0 commit comments

Comments
 (0)