diff --git a/reference/configuration/assetic.rst b/reference/configuration/assetic.rst
index 4331d8117a7..a30ba7ef450 100644
--- a/reference/configuration/assetic.rst
+++ b/reference/configuration/assetic.rst
@@ -4,119 +4,8 @@
AsseticBundle Configuration ("assetic")
=======================================
-.. include:: /assetic/_standard_edition_warning.rst.inc
+.. caution::
-Full Default Configuration
---------------------------
-
-.. configuration-block::
-
- .. code-block:: yaml
-
- # app/config/config.yml
- assetic:
- debug: '%kernel.debug%'
- use_controller:
- enabled: '%kernel.debug%'
- profiler: false
- read_from: '%assetic.read_from%'
- write_to: '%kernel.project_dir%/web'
- java: /usr/bin/java
- node: /usr/bin/node
- ruby: /usr/bin/ruby
- sass: /usr/bin/sass
- # An key-value pair of any number of named elements
- variables:
- some_name: []
- bundles:
-
- # Defaults (all currently registered bundles):
- - FrameworkBundle
- - SecurityBundle
- - TwigBundle
- - MonologBundle
- - SwiftmailerBundle
- - DoctrineBundle
- - AsseticBundle
- - ...
- assets:
- # An array of named assets (e.g. some_asset, some_other_asset)
- some_asset:
- inputs: []
- filters: []
- options:
- # A key-value array of options and values
- some_option_name: []
- filters:
-
- # An array of named filters (e.g. some_filter, some_other_filter)
- some_filter: []
- workers:
- # see https://github.com/symfony/AsseticBundle/pull/119
- # Cache can also be busted via the framework.assets.version
- # setting - see the "framework" configuration section
- cache_busting:
- enabled: false
- twig:
- functions:
- # An array of named functions (e.g. some_function, some_other_function)
- some_function: []
-
- .. code-block:: xml
-
-
-
-
-
-
-
-
- FrameworkBundle
- SecurityBundle
- TwigBundle
- MonologBundle
- SwiftmailerBundle
- DoctrineBundle
- AsseticBundle
- ...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Assetic is no longer recommended to manage web assets in Symfony
+ applications. Instead, use :doc:`Webpack Encore `, which bridges
+ Symfony applications with modern JavaScript tools used to manage web assets.
diff --git a/reference/configuration/debug.rst b/reference/configuration/debug.rst
index b9185488a68..3eb822cd62a 100644
--- a/reference/configuration/debug.rst
+++ b/reference/configuration/debug.rst
@@ -64,13 +64,13 @@ destination for dumps. Typically, you would set this to ``php://stderr``:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/debug.yaml
debug:
dump_destination: php://stderr
.. code-block:: xml
-
+
loadFromExtension('debug', array(
'dump_destination' => 'php://stderr',
));
diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst
index d7e32a282a4..5c5ea0c5b48 100644
--- a/reference/configuration/doctrine.rst
+++ b/reference/configuration/doctrine.rst
@@ -12,7 +12,7 @@ Full Default Configuration
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/doctrine.yaml
doctrine:
dbal:
default_connection: default
@@ -20,9 +20,9 @@ Full Default Configuration
# A collection of custom types
# Example
some_custom_type:
- class: Acme\HelloBundle\MyCustomType
+ class: App\DBAL\MyCustomType
commented: true
-
+
connections:
# A collection of different named connections (e.g. default, conn2, etc)
@@ -75,11 +75,11 @@ Full Default Configuration
mapping_types:
# an array of mapping types
name: []
-
+
# If defined, only the tables whose names match this regular expression are managed
# by the schema tool (in this example, any table name not starting with `wp_`)
#schema_filter: '/^(?!wp_)/'
-
+
slaves:
# a collection of named slave connections (e.g. slave1, slave2)
@@ -163,17 +163,17 @@ Full Default Configuration
# a collection of string functions
string_functions:
# example
- # test_string: Acme\HelloBundle\DQL\StringFunction
+ # test_string: App\DQL\StringFunction
# a collection of numeric functions
numeric_functions:
# example
- # test_numeric: Acme\HelloBundle\DQL\NumericFunction
+ # test_numeric: App\DQL\NumericFunction
# a collection of datetime functions
datetime_functions:
# example
- # test_datetime: Acme\HelloBundle\DQL\DatetimeFunction
+ # test_datetime: App\DQL\DatetimeFunction
# Register SQL Filters in the entity manager
filters:
@@ -184,7 +184,7 @@ Full Default Configuration
.. code-block:: xml
-
+
@@ -219,7 +219,7 @@ Full Default Configuration
string
- Acme\HelloBundle\MyCustomType
+ App\DBAL\MyCustomType
- Acme\HelloBundle\DQL\StringFunction
+ App\DQL\StringFunction
- Acme\HelloBundle\DQL\NumericFunction
+ App\DQL\NumericFunction
- Acme\HelloBundle\DQL\DatetimeFunction
+ App\DQL\DatetimeFunction
@@ -301,7 +301,7 @@ The following block shows all possible configuration keys:
password: secret
driver: pdo_mysql
# the DBAL driverClass option
- driver_class: MyNamespace\MyDriverImpl
+ driver_class: App\DBAL\MyDatabaseDriver
# the DBAL driverOptions option
options:
foo: bar
@@ -309,15 +309,15 @@ The following block shows all possible configuration keys:
memory: true
unix_socket: /tmp/mysql.sock
# the DBAL wrapperClass option
- wrapper_class: MyDoctrineDbalConnectionWrapper
+ wrapper_class: App\DBAL\MyConnectionWrapper
charset: UTF8
logging: '%kernel.debug%'
- platform_service: MyOwnDatabasePlatformService
+ platform_service: App\DBAL\MyDatabasePlatformService
server_version: 5.6
mapping_types:
enum: string
types:
- custom: Acme\HelloBundle\MyCustomType
+ custom: App\DBAL\MyCustomType
.. code-block:: xml
@@ -339,19 +339,19 @@ The following block shows all possible configuration keys:
user="user"
password="secret"
driver="pdo_mysql"
- driver-class="MyNamespace\MyDriverImpl"
+ driver-class="App\DBAL\MyDatabaseDriver"
path="%kernel.project_dir%/var/data/data.sqlite"
memory="true"
unix-socket="/tmp/mysql.sock"
- wrapper-class="MyDoctrineDbalConnectionWrapper"
+ wrapper-class="App\DBAL\MyConnectionWrapper"
charset="UTF8"
logging="%kernel.debug%"
- platform-service="MyOwnDatabasePlatformService"
+ platform-service="App\DBAL\MyDatabasePlatformService"
server-version="5.6">
bar
string
- Acme\HelloBundle\MyCustomType
+ App\DBAL\MyCustomType
@@ -480,7 +480,7 @@ The following example shows an overview of the caching configurations:
# the 'service' type requires to define the 'id' option too
query_cache_driver:
type: service
- id: my_doctrine_common_cache_service
+ id: App\ORM\MyCacheService
Mapping Configuration
~~~~~~~~~~~~~~~~~~~~~
@@ -492,42 +492,35 @@ you can control. The following configuration options exist for a mapping:
type
....
-One of ``annotation``, ``xml``, ``yml``, ``php`` or ``staticphp``. This
-specifies which type of metadata type your mapping uses.
+One of ``annotation`` (the default value), ``xml``, ``yml``, ``php`` or
+``staticphp``. This specifies which type of metadata type your mapping uses.
dir
...
-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.project_dir%``).
+Absolute path to the mapping or entity files (depending on the driver). The
+default value is ``%kernel.project_dir%/src/Entity/``.
prefix
......
-A common namespace prefix that all entities of this mapping share. This
-prefix should never conflict with prefixes of other defined mappings otherwise
-some of your entities cannot be found by Doctrine. This option defaults
-to the bundle namespace + ``Entity``, for example for an application bundle
-called AcmeHelloBundle prefix would be ``Acme\HelloBundle\Entity``.
+A common namespace prefix that all entities of this mapping share. This prefix
+should never conflict with prefixes of other defined mappings otherwise some of
+your entities cannot be found by Doctrine. This option defaults to
+``App\Entity`` because it's recommended to store the entities in ``src/Entity/``.
alias
.....
Doctrine offers a way to alias entity namespaces to simpler, shorter names
-to be used in DQL queries or for Repository access. When using a bundle
-the alias defaults to the bundle name.
+to be used in DQL queries or for Repository access. It's default value is ``App``.
is_bundle
.........
-This option is a derived value from ``dir`` and by default is set to ``true``
-if dir is relative proved by a ``file_exists()`` check that returns ``false``.
-It is ``false`` if the existence check returns ``true``. In this case an
-absolute path was specified and the metadata files are most likely in a
-directory outside of a bundle.
+This option is ``false`` by default and it's considered a legacy option. It was
+only useful in previous Symfony versions, when it was recommended to use bundles
+to organize the application code.
Custom Mapping Entities in a Bundle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -593,9 +586,7 @@ directory instead:
Mapping Entities Outside of a Bundle
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-You can also create new mappings, for example outside of the Symfony folder.
-
-For example, the following looks for entity classes in the ``App\Entity``
+For example, the following looks for entity classes in the ``Entity``
namespace in the ``src/Entity`` directory and gives them an ``App`` alias
(so you can say things like ``App:Post``):
@@ -662,7 +653,7 @@ If the ``type`` on the bundle configuration isn't set, the DoctrineBundle
will try to detect the correct mapping configuration format for the bundle.
DoctrineBundle will look for files matching ``*.orm.[FORMAT]`` (e.g.
-``Post.orm.yml``) in the configured ``dir`` of your mapping (if you're mapping
+``Post.orm.yaml``) in the configured ``dir`` of your mapping (if you're mapping
a bundle, then ``dir`` is relative to the bundle's directory).
The bundle looks for (in this order) XML, YAML and PHP files.
diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst
index 374edd23263..58602365003 100644
--- a/reference/configuration/framework.rst
+++ b/reference/configuration/framework.rst
@@ -180,7 +180,7 @@ named ``kernel.http_method_override``.
To fix this, invoke the ``enableHttpMethodParameterOverride()`` method
before creating the ``Request`` object::
- // web/app.php
+ // public/index.php
// ...
$kernel = new AppCache($kernel);
@@ -220,13 +220,13 @@ doubling them to prevent Symfony from interpreting them as container parameters)
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
ide: 'myide://open?url=file://%%f&line=%%l'
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'ide' => 'myide://open?url=file://%%f&line=%%l',
));
@@ -283,7 +283,7 @@ test
If this configuration setting is present (and not ``false``), then the services
related to testing your application (e.g. ``test.client``) are loaded. This
setting should be present in your ``test`` environment (usually via
-``app/config/config_test.yml``).
+``config/packages/test/framework.yaml``).
.. seealso::
@@ -334,13 +334,13 @@ respond and the user will receive a 400 response.
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
trusted_hosts: ['example.com', 'example.org']
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'trusted_hosts' => array('example.com', 'example.org'),
));
@@ -369,7 +369,7 @@ which make it easier to respond to any subdomain.
In addition, you can also set the trusted hosts in the front controller
using the ``Request::setTrustedHosts()`` method::
- // web/app.php
+ // public/index.php
Request::setTrustedHosts(array('^(.+\.)?example.com$', '^(.+\.)?example.org$'));
The default value for this option is an empty array, meaning that the application
@@ -450,13 +450,13 @@ You can also set ``esi`` to ``true`` to enable it:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
esi: true
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'esi' => true,
));
@@ -592,7 +592,7 @@ To configure a ``jsonp`` format:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
request:
formats:
@@ -600,7 +600,7 @@ To configure a ``jsonp`` format:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'request' => array(
'formats' => array(
@@ -824,14 +824,14 @@ setting the value to ``null``:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
session:
save_path: ~
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'session' => array(
'save_path' => null,
@@ -883,7 +883,7 @@ This option allows you to define a base path to be used for assets:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
# ...
assets:
@@ -891,7 +891,7 @@ This option allows you to define a base path to be used for assets:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
// ...
'assets' => array(
@@ -931,7 +931,7 @@ collection each time it generates an asset's path:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
# ...
assets:
@@ -940,7 +940,7 @@ collection each time it generates an asset's path:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
// ...
'assets' => array(
@@ -975,7 +975,7 @@ You can group assets into packages, to specify different base URLs for them:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
# ...
assets:
@@ -985,7 +985,7 @@ You can group assets into packages, to specify different base URLs for them:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
// ...
'assets' => array(
@@ -1070,7 +1070,7 @@ Now, activate the ``version`` option:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
# ...
assets:
@@ -1078,7 +1078,7 @@ Now, activate the ``version`` option:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
// ...
'assets' => array(
@@ -1175,7 +1175,7 @@ individually for each asset package:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
assets:
# this strategy is applied to every asset (including packages)
@@ -1193,7 +1193,7 @@ individually for each asset package:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'assets' => array(
'version_strategy' => 'app.asset.my_versioning_strategy',
@@ -1273,7 +1273,7 @@ package:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
assets:
# this manifest is applied to every asset (including packages)
@@ -1288,7 +1288,7 @@ package:
.. code-block:: xml
-
+
loadFromExtension('framework', array(
'assets' => array(
// this manifest is applied to every asset (including packages)
@@ -1371,23 +1371,23 @@ A list of all resources for form theming in PHP. This setting is not required
if you're using the Twig format for your templates, in that case refer to
:ref:`the form article `.
-Assume you have custom global form themes in
-``src/WebsiteBundle/Resources/views/Form``, you can configure this like:
+Assume you have custom global form themes in ``templates/form_themes/``, you can
+configure this like:
.. configuration-block::
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/framework.yaml
framework:
templating:
form:
resources:
- - 'WebsiteBundle:Form'
+ - 'form_themes'
.. code-block:: xml
-
+
-
-
-
- WebsiteBundle:Form
-
+ form_themes
-
-
.. code-block:: php
- // app/config/config.php
+ // config/packages/framework.php
$container->loadFromExtension('framework', array(
'templating' => array(
'form' => array(
'resources' => array(
- 'WebsiteBundle:Form'
+ 'form_themes'
),
),
),
diff --git a/reference/configuration/kernel.rst b/reference/configuration/kernel.rst
index 63d4ee42af6..3a1adc0c594 100644
--- a/reference/configuration/kernel.rst
+++ b/reference/configuration/kernel.rst
@@ -1,11 +1,11 @@
.. index::
single: Configuration reference; Kernel class
-Configuring in the Kernel (e.g. AppKernel)
-==========================================
+Configuring in the Kernel
+=========================
-Some configuration can be done on the kernel class itself (usually called
-``app/AppKernel.php``). You can do this by overriding specific methods in
+Some configuration can be done on the kernel class itself (located by default at
+``src/Kernel.php``). You can do this by overriding specific methods in
the parent :class:`Symfony\\Component\\HttpKernel\\Kernel` class.
Configuration
@@ -26,10 +26,11 @@ This returns the charset that is used in the application. To change it,
override the :method:`Symfony\\Component\\HttpKernel\\Kernel::getCharset`
method and return another charset, for instance::
- // app/AppKernel.php
-
+ // src/Kernel.php
+ use Symfony\Component\HttpKernel\Kernel as BaseKernel;
// ...
- class AppKernel extends Kernel
+
+ class Kernel extends BaseKernel
{
public function getCharset()
{
@@ -40,18 +41,17 @@ method and return another charset, for instance::
Kernel Name
~~~~~~~~~~~
-**type**: ``string`` **default**: ``app`` (i.e. the directory name holding
+**type**: ``string`` **default**: ``src`` (i.e. the directory name holding
the kernel class)
To change this setting, override the :method:`Symfony\\Component\\HttpKernel\\Kernel::getName`
method. Alternatively, move your kernel into a different directory. For
-example, if you moved the kernel into a ``foo`` directory (instead of ``app``),
+example, if you moved the kernel into a ``foo/`` directory (instead of ``src/``),
the kernel name will be ``foo``.
The name of the kernel isn't usually directly important - it's used in the
-generation of cache files. If you have an application with multiple kernels,
-the easiest way to make each have a unique name is to duplicate the ``app``
-directory and rename it to something else (e.g. ``foo``).
+generation of cache files - and you probably will only change it when
+:doc:`using applications with multiple kernels `.
Project Directory
~~~~~~~~~~~~~~~~~
@@ -65,10 +65,11 @@ If for some reason the ``composer.json`` file is not stored at the root of your
project, you can override the :method:`Symfony\\Component\\HttpKernel\\Kernel::getProjectDir`
method to return the right project directory::
- // app/AppKernel.php
-
+ // src/Kernel.php
+ use Symfony\Component\HttpKernel\Kernel as BaseKernel;
// ...
- class AppKernel extends Kernel
+
+ class Kernel extends BaseKernel
{
// ...
diff --git a/reference/configuration/monolog.rst b/reference/configuration/monolog.rst
index a067d95bc10..c2db56b574d 100644
--- a/reference/configuration/monolog.rst
+++ b/reference/configuration/monolog.rst
@@ -14,7 +14,7 @@ Full Default Configuration
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/monolog.yaml
monolog:
handlers:
@@ -77,7 +77,7 @@ Full Default Configuration
.. code-block:: xml
-
+
+
loadFromExtension('security', array(
'firewalls' => array(
'somename' => array(
diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst
index 2bf47c40859..a1b06c2af80 100644
--- a/reference/configuration/swiftmailer.rst
+++ b/reference/configuration/swiftmailer.rst
@@ -193,10 +193,11 @@ delivery_addresses
In previous versions, this option was called ``delivery_address``.
-If set, all email messages will be sent to these addresses instead of being
-sent to their actual recipients. This is often useful when developing. For
-example, by setting this in the ``config_dev.yml`` file, you can guarantee
-that all emails sent during development go to one or more some specific accounts.
+If set, all email messages will be sent to these addresses instead of being sent
+to their actual recipients. This is often useful when developing. For example,
+by setting this in the ``config/packages/dev/swiftmailer.yaml`` file, you can
+guarantee that all emails sent during development go to one or more some
+specific accounts.
This uses ``Swift_Plugins_RedirectingPlugin``. Original recipients are available
on the ``X-Swift-To``, ``X-Swift-Cc`` and ``X-Swift-Bcc`` headers.
diff --git a/reference/configuration/twig.rst b/reference/configuration/twig.rst
index c5c2a0acf54..5f132fcdbc7 100644
--- a/reference/configuration/twig.rst
+++ b/reference/configuration/twig.rst
@@ -8,7 +8,7 @@ TwigBundle Configuration ("twig")
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/twig.yaml
twig:
exception_controller: twig.controller.exception:showAction
@@ -70,7 +70,7 @@ TwigBundle Configuration ("twig")
.. code-block:: xml
-
+
loadFromExtension('twig', array(
'form_themes' => array(
'form_div_layout.html.twig', // Default
@@ -365,7 +365,7 @@ The values of the ``paths`` option are defined as ``key: value`` pairs where the
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/twig.yaml
twig:
# ...
paths:
@@ -373,7 +373,7 @@ The values of the ``paths`` option are defined as ``key: value`` pairs where the
.. code-block:: xml
-
+
loadFromExtension('twig', array(
// ...
'paths' => array(
@@ -409,7 +409,7 @@ for that directory:
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/twig.yaml
twig:
# ...
paths:
@@ -417,7 +417,7 @@ for that directory:
.. code-block:: xml
-
+
loadFromExtension('twig', array(
// ...
'paths' => array(
diff --git a/reference/configuration/web_profiler.rst b/reference/configuration/web_profiler.rst
index 2943b476cb6..0c1dfe492d0 100644
--- a/reference/configuration/web_profiler.rst
+++ b/reference/configuration/web_profiler.rst
@@ -58,7 +58,7 @@ Full Default Configuration
.. code-block:: yaml
- # app/config/config.yml
+ # config/packages/dev/web_profiler.yaml
web_profiler:
toolbar: false
intercept_redirects: false
@@ -66,7 +66,7 @@ Full Default Configuration
.. code-block:: xml
-
+
` doc
// ...
$builder->add('genre', EntityType::class, array(
- 'class' => 'MyBundle:Genre',
+ 'class' => 'App\Entity\Genre',
'choice_label' => 'translations[en].name',
));
diff --git a/reference/map.rst.inc b/reference/map.rst.inc
index 8339192ab96..cfc67ca0832 100644
--- a/reference/map.rst.inc
+++ b/reference/map.rst.inc
@@ -1,7 +1,7 @@
* **Configuration Options**
Ever wondered what configuration options you have available to you in
- files such as ``app/config/config.yml``? In this section, all the available
+ ``config/packages/*.yaml`` files? In this section, all the available
configuration is broken down by the key (e.g. ``framework``) that defines
each possible section of your Symfony configuration.