8000 replace kernel.root_dir with kernel.project_dir by xabbuh · Pull Request #7829 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

replace kernel.root_dir with kernel.project_dir #7829

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
merged 2 commits into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 6 additions & 6 deletions assetic/yuicompressor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ stylesheets:
# java: '/usr/bin/java'
filters:
yui_css:
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
jar: '%kernel.project_dir%/app/Resources/java/yuicompressor.jar'
yui_js:
jar: '%kernel.root_dir%/Resources/java/yuicompressor.jar'
jar: '%kernel.project_dir%/app/Resources/java/yuicompressor.jar'

.. code-block:: xml

Expand All @@ -57,10 +57,10 @@ stylesheets:
<assetic:config>
<assetic:filter
name="yui_css"
jar="%kernel.root_dir%/Resources/java/yuicompressor.jar" />
jar="%kernel.project_dir%/app/Resources/java/yuicompressor.jar" />
<assetic:filter
name="yui_js"
jar="%kernel.root_dir%/Resources/java/yuicompressor.jar" />
jar="%kernel.project_dir%/app/Resources/java/yuicompressor.jar" />
</assetic:config>
</container>

Expand All @@ -71,10 +71,10 @@ stylesheets:
// 'java' => '/usr/bin/java',
'filters' => array(
'yui_css' => array(
'jar' => '%kernel.root_dir%/Resources/java/yuicompressor.jar',
'jar' => '%kernel.project_dir%/app/Resources/java/yuicompressor.jar',
),
'yui_js' => array(
'jar' => '%kernel.root_dir%/Resources/java/yuicompressor.jar',
'jar' => '%kernel.project_dir%/app/Resources/java/yuicompressor.jar',
),
),
));
Expand Down
2 changes: 1 addition & 1 deletion bundles/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ The output will look like this:
use_controller:
enabled: '%kernel.debug%'
profiler: false
read_from: '%kernel.root_dir%/../web'
read_from: '%kernel.project_dir%/web'
write_to: '%assetic.read_from%'
java: /usr/bin/java
node: /usr/local/bin/node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# app/config/config.yml
imports:
- { resource: '%kernel.root_dir%/parameters.yml' }
- { resource: '%kernel.project_dir%/app/parameters.yml' }

.. code-block:: xml

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

<imports>
<import resource="%kernel.root_dir%/parameters.yml" />
<import resource="%kernel.project_dir%/app/parameters.yml" />
</imports>
</container>

.. code-block:: php

// app/config/config.php
$loader->import('%kernel.root_dir%/parameters.yml');
$loader->import('%kernel.project_dir%/app/parameters.yml');
6 changes: 3 additions & 3 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The main configuration file is called ``config.yml``:

framework:
secret: '%secret%'
router: { resource: '%kernel.root_dir%/config/routing.yml' }
router: { resource: '%kernel.project_dir%/app/config/routing.yml' }
# ...

# Twig Configuration
Expand Down Expand Up @@ -57,7 +57,7 @@ The main configuration file is called ``config.yml``:
</imports>

<framework:config secret="%secret%">
<framework:router resource="%kernel.root_dir%/config/routing.xml" />
<framework:router resource="%kernel.project_dir%/app/config/routing.xml" />
<!-- ... -->
</framework:config>

Expand All @@ -77,7 +77,7 @@ The main configuration file is called ``config.yml``:
$container->loadFromExtension('framework', array(
'secret' => '%secret%',
'router' => array(
'resource' => '%kernel.root_dir%/config/routing.php',
'resource' => '%kernel.project_dir%/app/config/routing.php',
),
// ...
));
Expand Down
6 changes: 3 additions & 3 deletions configuration/configuration_organization.rst
F438
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class::

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
$loader->load($this->getProjectDir().'/app/config/config_'.$this->getEnvironment().'.yml');
}
}

Expand Down Expand Up @@ -99,7 +99,7 @@ method::

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/'.$this->getEnvironment().'/config.yml');
$loader->load($this->getProjectDir().'/app/config/'.$this->getEnvironment().'/config.yml');
}
}

Expand Down Expand Up @@ -196,7 +196,7 @@ make Symfony aware of the new file organization::

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/environments/'.$this->getEnvironment().'.yml');
$loader->load($this->getProjectDir().'/app/config/environments/'.$this->getEnvironment().'.yml');
}
}

Expand Down
2 changes: 1 addition & 1 deletion configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class:

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
$loader->load($this->getProjectDir().'/app/config/config_'.$this->getEnvironment().'.yml');
}
}

Expand Down
4 changes: 2 additions & 2 deletions configuration/multiple_kernels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ they don't collide with the files from ``AppKernel``::

public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load($this->getRootDir().'/config/api/config_'.$this->getEnvironment().'.yml');
$loader->load($this->getProjectDir().'/app/config/api/config_'.$this->getEnvironment().'.yml');
}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ In order to solve this issue, add the following configuration to your kernel:
twig:
paths:
# allows to use app/Resources/views/ templates in the ApiKernel
"%kernel.root_dir%/../app/Resources/views": ~
"%kernel.project_dir%/app/Resources/views": ~

Adding more Kernels to the Application
--------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
# ...
assetic:
# ...
read_from: '%kernel.root_dir%/../../public_html'
read_from: '%kernel.project_dir%/../public_html'

.. code-block:: xml

Expand All @@ -150,7 +150,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">

<!-- ... -->
<assetic:config read-from="%kernel.root_dir%/../../public_html" />
<assetic:config read-from="%kernel.project_dir%/../public_html" />
</container>

.. code-block:: php
Expand All @@ -160,7 +160,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
// ...
$container->loadFromExtension('assetic', array(
// ...
'read_from' => '%kernel.root_dir%/../../public_html',
'read_from' => '%kernel.project_dir%/../public_html',
));

Now you just need to clear the cache and dump the assets again and your
Expand Down
2 changes: 1 addition & 1 deletion controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ controller to specify the directory in which the brochures should be stored:

# ...
parameters:
brochures_directory: '%kernel.root_dir%/../web/uploads/brochures'
brochures_directory: '%kernel.project_dir%/web/uploads/brochures'

There are some important things to consider in the code of the above controller:

Expand Down
6 changes: 3 additions & 3 deletions doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ can automatically generate an empty ``test_project`` database for you:
doctrine:
dbal:
driver: pdo_sqlite
path: '%kernel.root_dir%/sqlite.db'
path: '%kernel.project_dir%/app/sqlite.db'
charset: UTF8

.. code-block:: xml
Expand All @@ -225,7 +225,7 @@ can automatically generate an empty ``test_project`` database for you:
<doctrine:config>
<doctrine:dbal
driver="pdo_sqlite"
path="%kernel.root_dir%/sqlite.db"
path="%kernel.project_dir%/app/sqlite.db"
charset="UTF-8" />
</doctrine:config>
</container>
Expand All @@ -236,7 +236,7 @@ can automatically generate an empty ``test_project`` database for you:
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_sqlite',
'path' => '%kernel.root_dir%/sqlite.db',
'path' => '%kernel.project_dir%/app/sqlite.db',
'charset' => 'UTF-8',
),
));
Expand Down
4 changes: 2 additions & 2 deletions email/spool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ In order to use the spool with files, use the following configuration:
.. tip::

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

.. code-block:: yaml

path: '%kernel.root_dir%/spool'
path: '%kernel.project_dir%/app/spool'

Now, when your app sends an email, it will not actually be sent but instead
added to the spool. Sending the messages from the spool is done separately.
Expand Down
6 changes: 3 additions & 3 deletions frontend/custom_version_strategy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ After creating the strategy PHP class, register it as a Symfony service.
app.assets.versioning.gulp_buster:
class: AppBundle\Asset\VersionStrategy\GulpBusterVersionStrategy
arguments:
- "%kernel.root_dir%/../busters.json"
- "%kernel.project_dir%/busters.json"
- "%%s?version=%%s"
public: false

Expand All @@ -133,7 +133,7 @@ After creating the strategy PHP class, register it as a Symfony service.
<services>
<service id="app.assets.versioning.gulp_buster"
class="AppBundle\Asset\VersionStrategy\GulpBusterVersionStrategy" public="false">
<argument>%kernel.root_dir%/../busters.json</argument>
<argument>%kernel.project_dir%/busters.json</argument>
<argument>%%s?version=%%s</argument>
</service>
</services>
Expand All @@ -147,7 +147,7 @@ After creating the strategy PHP class, register it as a Symfony service.
$definition = new Definition(
'AppBundle\Asset\VersionStrategy\GulpBusterVersionStrategy',
array(
'%kernel.root_dir%/../busters.json',
'%kernel.project_dir%/busters.json',
'%%s?version=%%s',
)
);
Expand Down
4 changes: 2 additions & 2 deletions quick_tour/the_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ or PHP. Have a look at this sample of the default Symfony configuration:
#translator: { fallbacks: ['%locale%'] }
secret: '%secret%'
router:
resource: '%kernel.root_dir%/config/routing.yml'
resource: '%kernel.project_dir%/app/config/routing.yml'
strict_requirements: '%kernel.debug%'
form: true
csrf_protection: true
Expand Down Expand Up @@ -198,7 +198,7 @@ the ``config_dev.yml`` file, which loads the main configuration (i.e.
- { resource: config.yml }

framework:
router: { resource: '%kernel.root_dir%/config/routing_dev.yml' }
router: { resource: '%kernel.project_dir%/app/config/routing_dev.yml' }
profiler: { only_exceptions: false }

web_profiler:
Expand Down
4 changes: 2 additions & 2 deletions reference/configuration/assetic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Full Default Configuration
enabled: '%kernel.debug%'
profiler: false
read_from: '%assetic.read_from%'
write_to: '%kernel.root_dir%/../web'
write_to: '%kernel.project_dir%/web'
java: /usr/bin/java
node: /usr/bin/node
ruby: /usr/bin/ruby
Expand Down Expand Up @@ -78,7 +78,7 @@ Full Default Configuration
debug="%kernel.debug%"
use-controller="%kernel.debug%"
read-from="%assetic.read_from%"
write-to="%kernel.root_dir%/../web"
write-to="%kernel.project_dir%/web"
java="/usr/bin/java"
node="/usr/bin/node"
sass="/usr/bin/sass">
Expand Down
16 changes: 8 additions & 8 deletions reference/configuration/doctrine.rst
BAAF
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Full Default Configuration
password="secret"
driver="pdo_mysql"
driver-class="MyNamespace\MyDriverImpl"
path="%kernel.root_dir%/../var/data/data.sqlite"
path="%kernel.project_dir%/var/data/data.sqlite"
memory="true"
unix-socket="/tmp/mysql.sock"
wrapper-class="MyDoctrineDbalConnectionWrapper"
Expand Down Expand Up @@ -264,7 +264,7 @@ Full Default Configuration
<doctrine:mapping
name="DoctrineExtensions"
type="xml"
dir="%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/DoctrineExtensions/Entity"
dir="%kernel.project_dir%/vendor/gedmo/doctrine-extensions/lib/DoctrineExtensions/Entity"
prefix="DoctrineExtensions\Entity"
alias="DExt"
/>
Expand Down Expand Up @@ -340,7 +340,7 @@ Path to the mapping or entity files (depending on the driver). If this path
is relative it is assumed to be relative to the bundle root. This only works
if the name of your mapping is a bundle name. If you want to use this option
to specify absolute paths you should prefix the path with the kernel parameters
that exist in the DIC (for example ``%kernel.root_dir%``).
that exist in the DIC (for example ``%kernel.project_dir%``).

prefix
......
Expand Down Expand Up @@ -398,7 +398,7 @@ The following block shows all possible configuration keys:
# the DBAL driverOptions option
options:
foo: bar
path: '%kernel.root_dir%/data/data.sqlite'
path: '%kernel.project_dir%ta/data.sqlite'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%kernel.project_dir%ta/ should be %kernel.project_dir%/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original was '%kernel.root_dir%/data/data.sqlite', so the new one should be '%kernel.project_dir%/app/data/data.sqlite'

memory: true
unix_socket: /tmp/mysql.sock
# the DBAL wrapperClass option
Expand Down Expand Up @@ -434,7 +434,7 @@ The following block shows all possible configuration keys:
password="secret"
driver="pdo_mysql"
driver-class="MyNamespace\MyDriverImpl"
path="%kernel.root_dir%/../var/data/data.sqlite"
path="%kernel.project_dir%/var/data/data.sqlite"
memory="true"
unix-socket="/tmp/mysql.sock"
wrapper-class="MyDoctrineDbalConnectionWrapper"
Expand Down Expand Up @@ -605,7 +605,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
# ...
SomeEntityNamespace:
type: annotation
dir: '%kernel.root_dir%/../src/Entity'
dir: '%kernel.project_dir%/src/Entity'
is_bundle: false
prefix: App\Entity
alias: App
Expand All @@ -620,7 +620,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
<doctrine:orm>
<mapping name="SomeEntityNamespace"
type="annotation"
dir="%kernel.root_dir%/../src/Entity"
dir="%kernel.project_dir%/src/Entity"
is-bundle="false"
prefix="App\Entity"
alias="App"
Expand All @@ -637,7 +637,7 @@ namespace in the ``src/Entity`` directory and gives them an ``App`` alias
'mappings' => array(
'SomeEntityNamespace' => array(
'type' => 'annotation',
'dir' => '%kernel.root_dir%/../src/Entity',
'dir' => '%kernel.project_dir%/src/Entity',
'is_bundle' => false,
'prefix' => 'App\Entity',
'alias' => 'App',
Expand Down
Loading
0