Skip to content

Commit b49da4a

Browse files
committed
replace kernel.root_dir with kernel.project_dir
1 parent 2b1dbee commit b49da4a

19 files changed

+70
-70
lines changed

assetic/yuicompressor.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ stylesheets:
3838
# java: '/usr/bin/java'
3939
filters:
4040
yui_css:
41-
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
41+
jar: '%kernel.project_dir%/app/Resources/java/yuicompressor.jar'
4242
yui_js:
43-
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
43+
jar: '%kernel.project_dir%/app/Resources/java/yuicompressor.jar'
4444
4545
.. code-block:: xml
4646
@@ -57,10 +57,10 @@ stylesheets:
5757
<assetic:config>
5858
<assetic:filter
5959
name="yui_css"
60-
jar="%kernel.root_dir%/Resources/java/yuicompressor.jar" />
60+
jar="%kernel.project_dir%/app/Resources/java/yuicompressor.jar" />
6161
<assetic:filter
6262
name="yui_js"
63-
jar="%kernel.root_dir%/Resources/java/yuicompressor.jar" />
63+
jar="%kernel.project_dir%/app/Resources/java/yuicompressor.jar" />
6464
</assetic:config>
6565
</container>
6666
@@ -71,10 +71,10 @@ stylesheets:
7171
// 'java' => '/usr/bin/java',
7272
'filters' => array(
7373
'yui_css' => array(
74-
'jar' => '%kernel.root_dir%/Resources/java/yuicompressor.jar',
74+
'jar' => '%kernel.project_dir%/app/Resources/java/yuicompressor.jar',
7575
),
7676
'yui_js' => array(
77-
'jar' => '%kernel.root_dir%/Resources/java/yuicompressor.jar',
77+
'jar' => '%kernel.project_dir%/app/Resources/java/yuicompressor.jar',
7878
),
7979
),
8080
));

bundles/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The output will look like this:
125125
use_controller:
126126
enabled: '%kernel.debug%'
127127
profiler: false
128-
read_from: '%kernel.root_dir%/../web'
128+
read_from: '%kernel.project_dir%/web'
129129
write_to: '%assetic.read_from%'
130130
java: /usr/bin/java
131131
node: /usr/local/bin/node

components/dependency_injection/_imports-parameters-note.rst.inc

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# app/config/config.yml
1212
imports:
13-
- { resource: '%kernel.root_dir%/parameters.yml' }
13+
- { resource: '%kernel.project_dir%/app/parameters.yml' }
1414

1515
.. code-block:: xml
1616

@@ -22,11 +22,11 @@
2222
http://symfony.com/schema/dic/services/services-1.0.xsd">
2323

2424
<imports>
25-
<import resource="%kernel.root_dir%/parameters.yml" />
25+
<import resource="%kernel.project_dir%/app/parameters.yml" />
2626
</imports>
2727
</container>
2828

2929
.. code-block:: php
3030

3131
// app/config/config.php
32-
$loader->import('%kernel.root_dir%/parameters.yml');
32+
$loader->import('%kernel.project_dir%/app/parameters.yml');

configuration.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The main configuration file is called ``config.yml``:
2525
2626
framework:
2727
secret: '%secret%'
28-
router: { resource: '%kernel.root_dir%/config/routing.yml' }
28+
router: { resource: '%kernel.project_dir%/app/config/routing.yml' }
2929
# ...
3030
3131
# Twig Configuration
@@ -57,7 +57,7 @@ The main configuration file is called ``config.yml``:
5757
</imports>
5858
5959
<framework:config secret="%secret%">
60-
<framework:router resource="%kernel.root_dir%/config/routing.xml" />
60+
<framework:router resource="%kernel.project_dir%/app/config/routing.xml" />
6161
<!-- ... -->
6262
</framework:config>
6363
@@ -77,7 +77,7 @@ The main configuration file is called ``config.yml``:
7777
$container->loadFromExtension('framework', array(
7878
'secret' => '%secret%',
7979
'router' => array(
80-
'resource' => '%kernel.root_dir%/config/routing.php',
80+
'resource' => '%kernel.project_dir%/app/config/routing.php',
8181
),
8282
// ...
8383
));

configuration/configuration_organization.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class::
2323

2424
public function registerContainerConfiguration(LoaderInterface $loader)
2525
{
26-
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
26+
$loader->load($this->getProjectDir().'/app/config/config_'.$this->getEnvironment().'.yml');
2727
}
2828
}
2929

@@ -99,7 +99,7 @@ method::
9999

100100
public function registerContainerConfiguration(LoaderInterface $loader)
101101
{
102-
$loader->load($this->getRootDir().'/config/'.$this->getEnvironment().'/config.yml');
102+
$loader->load($this->getProjectDir().'/app/config/'.$this->getEnvironment().'/config.yml');
103103
}
104104
}
105105

@@ -196,7 +196,7 @@ make Symfony aware of the new file organization::
196196

197197
public function registerContainerConfiguration(LoaderInterface $loader)
198198
{
199-
$loader->load($this->getRootDir().'/config/environments/'.$this->getEnvironment().'.yml');
199+
$loader->load($this->getProjectDir().'/app/config/environments/'.$this->getEnvironment().'.yml');
200200
}
201201
}
202202

configuration/environments.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class:
4545
4646
public function registerContainerConfiguration(LoaderInterface $loader)
4747
{
48-
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
48+
$loader->load($this->getProjectDir().'/app/config/config_'.$this->getEnvironment().'.yml');
4949
}
5050
}
5151

configuration/multiple_kernels.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ they don't collide with the files from ``AppKernel``::
101101

102102
public function registerContainerConfiguration(LoaderInterface $loader)
103103
{
104-
$loader->load($this->getRootDir().'/config/api/config_'.$this->getEnvironment().'.yml');
104+
$loader->load($this->getProjectDir().'/app/config/api/config_'.$this->getEnvironment().'.yml');
105105
}
106106
}
107107

@@ -176,7 +176,7 @@ In order to solve this issue, add the following configuration to your kernel:
176176
twig:
177177
paths:
178178
# allows to use app/Resources/views/ templates in the ApiKernel
179-
"%kernel.root_dir%/../app/Resources/views": ~
179+
"%kernel.project_dir%/app/Resources/views": ~
180180
181181
Adding more Kernels to the Application
182182
--------------------------------------

configuration/override_dir_structure.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
135135
# ...
136136
assetic:
137137
# ...
138-
read_from: '%kernel.root_dir%/../../public_html'
138+
read_from: '%kernel.project_dir%/../public_html'
139139
140140
.. code-block:: xml
141141
@@ -150,7 +150,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
150150
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
151151
152152
<!-- ... -->
153-
<assetic:config read-from="%kernel.root_dir%/../../public_html" />
153+
<assetic:config read-from="%kernel.project_dir%/../public_html" />
154154
</container>
155155
156156
.. code-block:: php
@@ -160,7 +160,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
160160
// ...
161161
$container->loadFromExtension('assetic', array(
162162
// ...
163-
'read_from' => '%kernel.root_dir%/../../public_html',
163+
'read_from' => '%kernel.project_dir%/../public_html',
164164
));
165165
166166
Now you just need to clear the cache and dump the assets again and your

controller/upload_file.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ controller to specify the directory in which the brochures should be stored:
165165
166166
# ...
167167
parameters:
168-
brochures_directory: '%kernel.root_dir%/../web/uploads/brochures'
168+
brochures_directory: '%kernel.project_dir%/web/uploads/brochures'
169169
170170
There are some important things to consider in the code of the above controller:
171171

doctrine.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ can automatically generate an empty ``test_project`` database for you:
207207
doctrine:
208208
dbal:
209209
driver: pdo_sqlite
210-
path: '%kernel.root_dir%/sqlite.db'
210+
path: '%kernel.project_dir%/app/sqlite.db'
211211
charset: UTF8
212212
213213
.. code-block:: xml
@@ -225,7 +225,7 @@ can automatically generate an empty ``test_project`` database for you:
225225
<doctrine:config>
226226
<doctrine:dbal
227227
driver="pdo_sqlite"
228-
path="%kernel.root_dir%/sqlite.db"
228+
path="%kernel.project_dir%/app/sqlite.db"
229229
charset="UTF-8" />
230230
</doctrine:config>
231231
</container>
@@ -236,7 +236,7 @@ can automatically generate an empty ``test_project`` database for you:
236236
$container->loadFromExtension('doctrine', array(
237237
'dbal' => array(
238238
'driver' => 'pdo_sqlite',
239-
'path' => '%kernel.root_dir%/sqlite.db',
239+
'path' => '%kernel.project_dir%/app/sqlite.db',
240240
'charset' => 'UTF-8',
241241
),
242242
));

email/spool.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ In order to use the spool with files, use the following configuration:
111111
.. tip::
112112

113113
If you want to store the spool somewhere with your project directory,
114-
remember that you can use the ``%kernel.root_dir%`` parameter to reference
114+
remember that you can use the ``%kernel.project_dir%`` parameter to reference
115115
the project's root:
116116

117117
.. code-block:: yaml
118118
119-
path: '%kernel.root_dir%/spool'
119+
path: '%kernel.project_dir%/app/spool'
120120
121121
Now, when your app sends an email, it will not actually be sent but instead
122122
added to the spool. Sending the messages from the spool is done separately.

frontend/custom_version_strategy.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ After creating the strategy PHP class, register it as a Symfony service.
117117
app.assets.versioning.gulp_buster:
118118
class: AppBundle\Asset\VersionStrategy\GulpBusterVersionStrategy
119119
arguments:
120-
- "%kernel.root_dir%/../busters.json"
120+
- "%kernel.project_dir%/busters.json"
121121
- "%%s?version=%%s"
122122
public: false
123123
@@ -133,7 +133,7 @@ After creating the strategy PHP class, register it as a Symfony service.
133133
<services>
134134
<service id="app.assets.versioning.gulp_buster"
135135
class="AppBundle\Asset\VersionStrategy\GulpBusterVersionStrategy" public="false">
136-
<argument>%kernel.root_dir%/../busters.json</argument>
136+
<argument>%kernel.project_dir%/busters.json</argument>
137137
<argument>%%s?version=%%s</argument>
138138
</service>
139139
</services>
@@ -147,7 +147,7 @@ After creating the strategy PHP class, register it as a Symfony service.
147147
$definition = new Definition(
148148
'AppBundle\Asset\VersionStrategy\GulpBusterVersionStrategy',
149149
array(
150-
'%kernel.root_dir%/../busters.json',
150+
'%kernel.project_dir%/busters.json',
151151
'%%s?version=%%s',
152152
)
153153
);

quick_tour/the_architecture.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ or PHP. Have a look at this sample of the default Symfony configuration:
156156
#translator: { fallbacks: ['%locale%'] }
157157
secret: '%secret%'
158158
router:
159-
resource: '%kernel.root_dir%/config/routing.yml'
159+
resource: '%kernel.project_dir%/app/config/routing.yml'
160160
strict_requirements: '%kernel.debug%'
161161
form: true
162162
csrf_protection: true
@@ -198,7 +198,7 @@ the ``config_dev.yml`` file, which loads the main configuration (i.e.
198198
- { resource: config.yml }
199199
200200
framework:
201-
router: { resource: '%kernel.root_dir%/config/routing_dev.yml' }
201+
router: { resource: '%kernel.project_dir%/app/config/routing_dev.yml' }
202202
profiler: { only_exceptions: false }
203203
204204
web_profiler:

reference/configuration/assetic.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Full Default Configuration
2020
enabled: '%kernel.debug%'
2121
profiler: false
2222
read_from: '%assetic.read_from%'
23-
write_to: '%kernel.root_dir%/../web'
23+
write_to: '%kernel.project_dir%/web'
2424
java: /usr/bin/java
2525
node: /usr/bin/node
2626
ruby: /usr/bin/ruby
@@ -78,7 +78,7 @@ Full Default Configuration
7878
debug="%kernel.debug%"
7979
use-controller="%kernel.debug%"
8080
read-from="%assetic.read_from%"
81-
write-to="%kernel.root_dir%/../web"
81+
write-to="%kernel.project_dir%/web"
8282
java="/usr/bin/java"
8383
node="/usr/bin/node"
8484
sass="/usr/bin/sass">

reference/configuration/doctrine.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Full Default Configuration
205205
password="secret"
206206
driver="pdo_mysql"
207207
driver-class="MyNamespace\MyDriverImpl"
208-
path="%kernel.root_dir%/../var/data/data.sqlite"
208+
path="%kernel.project_dir%/var/data/data.sqlite"
209209
memory="true"
210210
unix-socket="/tmp/mysql.sock"
211211
wrapper-class="MyDoctrineDbalConnectionWrapper"
@@ -264,7 +264,7 @@ Full Default Configuration
264264
<doctrine:mapping
265265
name="DoctrineExtensions"
266266
type="xml"
267-
dir="%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/DoctrineExtensions/Entity"
267+
dir="%kernel.project_dir%/vendor/gedmo/doctrine-extensions/lib/DoctrineExtensions/Entity"
268268
prefix="DoctrineExtensions\Entity"
269269
alias="DExt"
270270
/>
@@ -340,7 +340,7 @@ Path to the mapping or entity files (depending on the driver). If this path
340340
is relative it is assumed to be relative to the bundle root. This only works
341341
if the name of your mapping is a bundle name. If you want to use this option
342342
to specify absolute paths you should prefix the path with the kernel parameters
343-
that exist in the DIC (for example ``%kernel.root_dir%``).
343+
that exist in the DIC (for example ``%kernel.project_dir%``).
344344

345345
prefix
346346
......
@@ -398,7 +398,7 @@ The following block shows all possible configuration keys:
398398
# the DBAL driverOptions option
399399
options:
400400
foo: bar
401-
path: '%kernel.root_dir%/data/data.sqlite'
401+
path: '%kernel.project_dir%ta/data.sqlite'
402402
memory: true
403403
unix_socket: /tmp/mysql.sock
404404
# the DBAL wrapperClass option
@@ -434,7 +434,7 @@ The following block shows all possible configuration keys:
434434
password="secret"
435435
driver="pdo_mysql"
436436
driver-class="MyNamespace\MyDriverImpl"
437-
path="%kernel.root_dir%/../var/data/data.sqlite"
437+
path="%kernel.project_dir%/var/data/data.sqlite"
438438
memory="true"
439439
unix-socket="/tmp/mysql.sock"
440440
wrapper-class="MyDoctrineDbalConnectionWrapper"
@@ -605,7 +605,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
605605
# ...
606606
SomeEntityNamespace:
607607
type: annotation
608-
dir: '%kernel.root_dir%/../src/Entity'
608+
dir: '%kernel.project_dir%/src/Entity'
609609
is_bundle: false
610610
prefix: App\Entity
611611
alias: App
@@ -620,7 +620,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
620620
<doctrine:orm>
621621
<mapping name="SomeEntityNamespace"
622622
type="annotation"
623-
dir="%kernel.root_dir%/../src/Entity"
623+
dir="%kernel.project_dir%/src/Entity"
624624
is-bundle="false"
625625
prefix="App\Entity"
626626
alias="App"
@@ -637,7 +637,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
637637
'mappings' => array(
638638
'SomeEntityNamespace' => array(
639639
'type' => 'annotation',
640-
'dir' => '%kernel.root_dir%/../src/Entity',
640+
'dir' => '%kernel.project_dir%/src/Entity',
641641
'is_bundle' => false,
642642
'prefix' => 'App\Entity',
643643
'alias' => 'App',

0 commit comments

Comments
 (0)