Skip to content

Commit b8a17f6

Browse files
committed
[symfony#1860] Reverting the removal of the kernel.root_dir use
I don't see any disadvantages for using a parameter here that *happens* to be used in the framework - the advantage is that it's meaningful for half the audience (and for component users, any parameter here will be a "generic")
1 parent d2445f9 commit b8a17f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/dependency_injection/advanced.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
107107
services:
108108
foo:
109109
class: Example\Foo\Bar
110-
file: "%app.root_dir%/src/path/to/file/foo.php"
110+
file: "%kernel.root_dir%/src/path/to/file/foo.php"
111111
112112
.. code-block:: xml
113113
114114
<service id="foo" class="Example\Foo\Bar">
115-
<file>%app.root_dir%/src/path/to/file/foo.php</file>
115+
<file>%kernel.root_dir%/src/path/to/file/foo.php</file>
116116
</service>
117117
118118
.. code-block:: php
119119
120120
$definition = new Definition('Example\Foo\Bar');
121-
$definition->setFile('%app.root_dir%/src/path/to/file/foo.php');
121+
$definition->setFile('%kernel.root_dir%/src/path/to/file/foo.php');
122122
$container->setDefinition('foo', $definition);
123123
124124
Notice that symfony will internally call the PHP function require_once

0 commit comments

Comments
 (0)