Skip to content

Commit 4b23bd7

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Removed the full config dumps from config reference articles Mention that the component implements both patterns Update event_dispatcher.rst Observer instead of Mediator pattern Recommend to use real env vars in production Update dotenv usage
2 parents c7c57fc + fb5c50f commit 4b23bd7

File tree

10 files changed

+126
-926
lines changed

10 files changed

+126
-926
lines changed

components/dotenv.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ You should never store a ``.env`` file in your code repository as it might
6666
contain sensitive information; create a ``.env.dist`` file with sensible
6767
defaults instead.
6868

69-
Symfony Dotenv should only be used in development/testing/staging environments.
70-
For production environments, use "real" environment variables.
69+
.. note::
70+
71+
Symfony Dotenv can be used in any environment of your application:
72+
development, testing, staging and even production. However, in production
73+
it's recommended to configure real environment variables to avoid the
74+
performance overhead of parsing the ``.env`` file for every request.
7175

7276
As a ``.env`` file is a regular shell script, you can ``source`` it in your own
7377
shell scripts:

components/event_dispatcher.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ before or after a method is executed, without interfering with other plugins.
2525
This is not an easy problem to solve with single inheritance, and even if
2626
multiple inheritance was possible with PHP, it comes with its own drawbacks.
2727

28-
The Symfony EventDispatcher component implements the `Mediator`_ pattern
29-
in a simple and effective way to make all these things possible and to make
30-
your projects truly extensible.
28+
The Symfony EventDispatcher component implements the `Mediator`_ and `Observer`_
29+
design patterns to make all these things possible and to make your projects
30+
truly extensible.
3131

3232
Take a simple example from :doc:`the HttpKernel component </components/http_kernel>`.
3333
Once a ``Response`` object has been created, it may be useful to allow other
@@ -519,6 +519,7 @@ Learn More
519519
* :ref:`The kernel.event_subscriber tag <dic-tags-kernel-event-subscriber>`
520520

521521
.. _Mediator: https://en.wikipedia.org/wiki/Mediator_pattern
522+
.. _Observer: https://en.wikipedia.org/wiki/Observer_pattern
522523
.. _Closures: https://php.net/manual/en/functions.anonymous.php
523524
.. _PHP callable: https://php.net/manual/en/language.pseudo-types.php#language.types.callback
524525
.. _Packagist: https://packagist.org/packages/symfony/event-dispatcher

reference/configuration/debug.rst

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
.. index::
22
single: Configuration reference; Framework
33

4-
DebugBundle Configuration ("debug")
5-
===================================
4+
Debug Configuration Reference (DebugBundle)
5+
===========================================
66

7-
The DebugBundle allows greater integration of the
8-
:doc:`VarDumper component </components/var_dumper>` in the
9-
Symfony full-stack framework and can be configured under the ``debug`` key
10-
in your application configuration. When using XML, you must use the
11-
``http://symfony.com/schema/dic/debug`` namespace.
7+
The DebugBundle integrates the :doc:`VarDumper component </components/var_dumper>`
8+
in Symfony applications. All these options are configured under the ``debug``
9+
key in your application configuration.
1210

13-
.. tip::
11+
.. code-block:: terminal
1412
15-
The XSD schema is available at
16-
``http://symfony.com/schema/dic/debug/debug-1.0.xsd``.
13+
# displays the default config values defined by Symfony
14+
$ php bin/console config:dump-reference debug
15+
16+
# displays the actual config values used by your application
17+
$ php bin/console debug:config debug
18+
19+
.. note::
20+
21+
When using XML, you must use the ``http://symfony.com/schema/dic/debug``
22+
namespace and the related XSD schema is available at:
23+
``http://symfony.com/schema/dic/debug/debug-1.0.xsd``
1724

1825
Configuration
1926
-------------

reference/configuration/doctrine.rst

Lines changed: 15 additions & 271 deletions
Original file line numberDiff line numberDiff line change
@@ -2,283 +2,27 @@
22
single: Doctrine; ORM configuration reference
33
single: Configuration reference; Doctrine ORM
44

5-
DoctrineBundle Configuration ("doctrine")
6-
=========================================
5+
Doctrine Configuration Reference (DoctrineBundle)
6+
=================================================
77

8-
Full Default Configuration
9-
--------------------------
10-
11-
.. configuration-block::
8+
The DoctrineBundle integrates both the :doc:`DBAL </doctrine/dbal>` and
9+
:doc:`ORM </doctrine>` Doctrine projects in Symfony applications. All these
10+
options are configured under the ``doctrine`` key in your application
11+
configuration.
1212

13-
.. code-block:: yaml
13+
.. code-block:: terminal
1414
15-
# config/packages/doctrine.yaml
16-
doctrine:
17-
dbal:
18-
default_connection: default
19-
types:
20-
# A collection of custom types
21-
# Example
22-
some_custom_type:
23-
class: App\DBAL\MyCustomType
24-
commented: true
25-
26-
connections:
27-
# A collection of different named connections (e.g. default, conn2, etc)
28-
default:
29-
dbname: ~
30-
host: localhost
31-
port: ~
32-
user: root
33-
password: ~
34-
# charset of the database
35-
charset: ~
36-
# charset and collation of the tables. Not inherited from database
37-
default_table_options:
38-
charset: ~
39-
collate: ~
40-
path: ~
41-
memory: ~
42-
43-
# The unix socket to use for MySQL
44-
unix_socket: ~
45-
46-
# True to use as persistent connection for the ibm_db2 driver
47-
persistent: ~
48-
49-
# The protocol to use for the ibm_db2 driver (default to TCPIP if omitted)
50-
protocol: ~
51-
52-
# True to use dbname as service name instead of SID for Oracle
53-
service: ~
54-
55-
# The session mode to use for the oci8 driver
56-
sessionMode: ~
57-
58-
# True to use a pooled server with the oci8 driver
59-
pooled: ~
60-
61-
# Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
62-
MultipleActiveResultSets: ~
63-
driver: pdo_mysql
64-
platform_service: ~
65-
66-
# the version of your database engine
67-
server_version: ~
68-
69-
# when true, queries are logged to a 'doctrine' monolog channel
70-
logging: '%kernel.debug%'
71-
profiling: '%kernel.debug%'
72-
driver_class: ~
73-
wrapper_class: ~
74-
# the DBAL keepSlave option
75-
keep_slave: false
76-
options:
77-
# an array of options
78-
key: []
79-
mapping_types:
80-
# an array of mapping types
81-
name: []
82-
83-
# If defined, only the tables whose names match this regular expression are managed
84-
# by the schema tool (in this example, any table name not starting with `wp_`)
85-
#schema_filter: '/^(?!wp_)/'
86-
87-
slaves:
88-
89-
# a collection of named slave connections (e.g. slave1, slave2)
90-
slave1:
91-
dbname: ~
92-
host: localhost
93-
port: ~
94-
user: root
95-
password: ~
96-
charset: ~
97-
path: ~
98-
memory: ~
99-
100-
# The unix socket to use for MySQL
101-
unix_socket: ~
102-
103-
# True to use as persistent connection for the ibm_db2 driver
104-
persistent: ~
105-
106-
# The protocol to use for the ibm_db2 driver (default to TCPIP if omitted)
107-
protocol: ~
108-
109-
# True to use dbname as service name instead of SID for Oracle
110-
service: ~
111-
112-
# The session mode to use for the oci8 driver
113-
sessionMode: ~
114-
115-
# True to use a pooled server with the oci8 driver
116-
pooled: ~
117-
118-
# Configuring MultipleActiveResultSets for the pdo_sqlsrv driver
119-
MultipleActiveResultSets: ~
15+
# displays the default config values defined by Symfony
16+
$ php bin/console config:dump-reference doctrine
12017
121-
orm:
122-
default_entity_manager: ~
123-
auto_generate_proxy_classes: false
124-
proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
125-
proxy_namespace: Proxies
126-
# search for the "ResolveTargetEntityListener" class for an article about this
127-
resolve_target_entities: []
128-
entity_managers:
129-
# A collection of different named entity managers (e.g. some_em, another_em)
130-
some_em:
131-
query_cache_driver:
132-
type: array # Required
133-
host: ~
134-
port: ~
135-
instance_class: ~
136-
class: ~
137-
namespace: ~
138-
metadata_cache_driver:
139-
type: array # Required
140-
host: ~
141-
port: ~
142-
instance_class: ~
143-
class: ~
144-
namespace: ~
145-
result_cache_driver:
146-
type: array # Required
147-
host: ~
148-
port: ~
149-
instance_class: ~
150-
class: ~
151-
namespace: ~
152-
connection: ~
153-
class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory
154-
default_repository_class: Doctrine\ORM\EntityRepository
155-
auto_mapping: false
156-
hydrators:
157-
158-
# An array of hydrator names
159-
hydrator_name: []
160-
mappings:
161-
# An array of mappings, which may be a bundle name or something else
162-
mapping_name:
163-
mapping: true
164-
type: ~
165-
dir: ~
166-
alias: ~
167-
prefix: ~
168-
is_bundle: ~
169-
dql:
170-
# a collection of string functions
171-
string_functions:
172-
# example
173-
# test_string: App\DQL\StringFunction
174-
175-
# a collection of numeric functions
176-
numeric_functions:
177-
# example
178-
# test_numeric: App\DQL\NumericFunction
179-
180-
# a collection of datetime functions
181-
datetime_functions:
182-
# example
183-
# test_datetime: App\DQL\DatetimeFunction
184-
185-
# Register SQL Filters in the entity manager
186-
filters:
187-
# An array of filters
188-
some_filter:
189-
class: ~ # Required
190-
enabled: false
191-
192-
.. code-block:: xml
193-
194-
<!-- config/packages/doctrine.xml -->
195-
<?xml version="1.0" encoding="UTF-8" ?>
196-
<container xmlns="http://symfony.com/schema/dic/services"
197-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
198-
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
199-
xsi:schemaLocation="http://symfony.com/schema/dic/services
200-
http://symfony.com/schema/dic/services/services-1.0.xsd
201-
http://symfony.com/schema/dic/doctrine
202-
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
18+
# displays the actual config values used by your application
19+
$ php bin/console debug:config doctrine
20320
204-
<doctrine:config>
205-
<doctrine:dbal default-connection="default">
206-
<doctrine:connection
207-
name="default"
208-
dbname="database"
209-
host="localhost"
210-
port="1234"
211-
user="user"
212-
password="secret"
213-
driver="pdo_mysql"
214-
driver-class="App\DBAL\MyDatabaseDriver"
215-
path="%kernel.project_dir%/var/data/data.sqlite"
216-
memory="true"
217-
unix-socket="/tmp/mysql.sock"
218-
wrapper-class="App\DBAL\MyConnectionWrapper"
219-
charset="UTF8"
220-
logging="%kernel.debug%"
221-
platform-service="App\DBAL\MyDatabasePlatformService"
222-
server-version="5.6"
223-
keep-slave="false"
224-
>
225-
<doctrine:option key="foo">bar</doctrine:option>
226-
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
227-
</doctrine:connection>
228-
<doctrine:connection name="conn1" />
229-
<doctrine:type name="custom">App\DBAL\MyCustomType</doctrine:type>
230-
</doctrine:dbal>
21+
.. note::
23122

232-
<doctrine:orm
233-
default-entity-manager="default"
234-
auto-generate-proxy-classes="false"
235-
proxy-namespace="Proxies"
236-
proxy-dir="%kernel.cache_dir%/doctrine/orm/Proxies"
237-
>
238-
<doctrine:entity-manager
239-
name="default"
240-
query-cache-driver="array"
241-
result-cache-driver="array"
242-
connection="conn1"
243-
class-metadata-factory-name="Doctrine\ORM\Mapping\ClassMetadataFactory"
244-
>
245-
<doctrine:metadata-cache-driver
246-
type="memcache"
247-
host="localhost"
248-
port="11211"
249-
instance-class="Memcache"
250-
class="Doctrine\Common\Cache\MemcacheCache"
251-
/>
252-
253-
<doctrine:mapping name="AcmeHelloBundle" />
254-
255-
<doctrine:dql>
256-
<doctrine:string-function name="test_string">
257-
App\DQL\StringFunction
258-
</doctrine:string-function>
259-
260-
<doctrine:numeric-function name="test_numeric">
261-
App\DQL\NumericFunction
262-
</doctrine:numeric-function>
263-
264-
<doctrine:datetime-function name="test_datetime">
265-
App\DQL\DatetimeFunction
266-
</doctrine:datetime-function>
267-
</doctrine:dql>
268-
</doctrine:entity-manager>
269-
270-
<doctrine:entity-manager name="em2" connection="conn2" metadata-cache-driver="apc">
271-
<doctrine:mapping
272-
name="DoctrineExtensions"
273-
type="xml"
274-
dir="%kernel.project_dir%/vendor/gedmo/doctrine-extensions/lib/DoctrineExtensions/Entity"
275-
prefix="DoctrineExtensions\Entity"
276-
alias="DExt"
277-
/>
278-
</doctrine:entity-manager>
279-
</doctrine:orm>
280-
</doctrine:config>
281-
</container>
23+
When using XML, you must use the ``http://symfony.com/schema/dic/doctrine``
24+
namespace and the related XSD schema is available at:
25+
``http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd``
28226

28327
.. index::
28428
single: Configuration; Doctrine DBAL

reference/configuration/framework.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
.. _framework-bundle-configuration:
55

6-
FrameworkBundle Configuration ("framework")
7-
===========================================
6+
Framework Configuration Reference (FrameworkBundle)
7+
===================================================
88

99
The FrameworkBundle defines the main framework configuration, from sessions and
1010
translations to forms, validation, routing and more. All these options are
@@ -13,7 +13,7 @@ configured under the ``framework`` key in your application configuration.
1313
.. code-block:: terminal
1414
1515
# displays the default config values defined by Symfony
16-
$ php bin/console config:dump framework
16+
$ php bin/console config:dump-reference framework
1717
1818
# displays the actual config values used by your application
1919
$ php bin/console debug:config framework

0 commit comments

Comments
 (0)