Skip to content

Commit 7368651

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Added the versionadded directive [Encore] Fix vue-loader installation Add section about anonymous services in YAML update the serializer cache description
2 parents e86ebd1 + f3ee84c commit 7368651

File tree

4 files changed

+68
-21
lines changed

4 files changed

+68
-21
lines changed

frontend/encore/vuejs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Want to use `Vue.js`_? No problem! First, install Vue and some dependencies:
55

66
.. code-block:: terminal
77
8-
$ yarn add --dev vue vue-loader vue-template-compiler
8+
$ yarn add --dev vue vue-loader@^14 vue-template-compiler
99
1010
Then, activate the ``vue-loader`` in ``webpack.config.js``:
1111

reference/configuration/framework.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,8 @@ ships with multiple adapters: ``cache.adapter.apcu``, ``cache.adapter.doctrine``
17831783
given the adapter they are based on. Internally, a pool wraps the definition
17841784
of an adapter.
17851785

1786+
.. _reference-cache-systen:
1787+
17861788
system
17871789
......
17881790

serializer.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ stored in one of the following locations:
147147
Configuring the Metadata Cache
148148
------------------------------
149149

150-
The metadata for the serializer is automatically cached. To configure the cache,
151-
configure the ``framework.cache.pools`` key in ``config/packages/framework.yaml``.
150+
The metadata for the serializer is automatically cached to enhance application
151+
performance. By default, the serializer uses the ``cache.system`` cache pool
152+
which is configured using the :ref:`cache.system <reference-cache-systen>`
153+
option.
152154

153155
Enabling a Name Converter
154156
-------------------------

service_container/alias_private.rst

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,10 @@ Anonymous Services
151151

152152
.. note::
153153

154-
Anonymous services are only supported by the XML configuration format.
154+
Anonymous services are only supported by the XML and YAML configuration formats.
155+
156+
.. versionadded:: 3.3
157+
The feature to configure anonymous services in YAML was introduced in Symfony 3.3.
155158

156159
In some cases, you may want to prevent a service being used as a dependency of
157160
other services. This can be achieved by creating an anonymous service. These
@@ -160,23 +163,63 @@ created where they are used.
160163

161164
The following example shows how to inject an anonymous service into another service:
162165

163-
.. code-block:: xml
164-
165-
<!-- app/config/services.xml -->
166-
<?xml version="1.0" encoding="UTF-8" ?>
167-
<container xmlns="http://symfony.com/schema/dic/services"
168-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
169-
xsi:schemaLocation="http://symfony.com/schema/dic/services
170-
http://symfony.com/schema/dic/services/services-1.0.xsd">
171-
172-
<services>
173-
<service id="foo" class="App\Foo">
174-
<argument type="service">
175-
<service class="App\AnonymousBar" />
176-
</argument>
177-
</service>
178-
</services>
179-
</container>
166+
.. configuration-block::
167+
168+
.. code-block:: yaml
169+
170+
# app/config/services.yaml
171+
services:
172+
App\Foo:
173+
arguments:
174+
- !service
175+
class: App\AnonymousBar
176+
177+
.. code-block:: xml
178+
179+
<!-- app/config/services.xml -->
180+
<?xml version="1.0" encoding="UTF-8" ?>
181+
<container xmlns="http://symfony.com/schema/dic/services"
182+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
183+
xsi:schemaLocation="http://symfony.com/schema/dic/services
184+
http://symfony.com/schema/dic/services/services-1.0.xsd">
185+
186+
<services>
187+
<service id="foo" class="App\Foo">
188+
<argument type="service">
189+
<service class="App\AnonymousBar" />
190+
</argument>
191+
</service>
192+
</services>
193+
</container>
194+
195+
Using an anonymous service as a factory looks like this:
196+
197+
.. configuration-block::
198+
199+
.. code-block:: yaml
200+
201+
# app/config/services.yaml
202+
services:
203+
App\Foo:
204+
factory: [ !service { class: App\FooFactory }, 'constructFoo' ]
205+
206+
.. code-block:: xml
207+
208+
<!-- app/config/services.xml -->
209+
<?xml version="1.0" encoding="UTF-8" ?>
210+
<container xmlns="http://symfony.com/schema/dic/services"
211+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
212+
xsi:schemaLocation="http://symfony.com/schema/dic/services
213+
http://symfony.com/schema/dic/services/services-1.0.xsd">
214+
215+
<services>
216+
<service id="foo" class="App\Foo">
217+
<factory method="constructFoo">
218+
<service class="App\FooFactory"/>
219+
</factory>
220+
</service>
221+
</services>
222+
</container>
180223
181224
Deprecating Services
182225
--------------------

0 commit comments

Comments
 (0)