Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5629491

Browse filesBrowse files
committed
Merge branch '3.2'
* 3.2: [#7427] fix line length Add apcu cache driver to doctrine config reference Change type of arguments min and max [#7383] minor rewording Added a note about not using the ClassLoader component Update guard_authentication.rst More clear description of factory service creation [#7376] minor wording improvement Added a tip about the expanded YAML syntax Added a minor help note about Request::setTrustedProxies Fix Apache 2.4 UDS instructions Fix doc for yaml parameters constants usage remove unused options parameter from loadManifest Tweaks based on feedback! Covering two missing adapters introduced in 3.2 See #7362 bundles/override > Rewrite translations block
2 parents 002359f + 42c7ea8 commit 5629491
Copy full SHA for 5629491

File tree

12 files changed

+197
-59
lines changed
Filter options

12 files changed

+197
-59
lines changed

‎bundles/override.rst

Copy file name to clipboardExpand all lines: bundles/override.rst
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,11 @@ can override the translations from any translation file, as long as it is in
154154

155155
.. caution::
156156

157-
The last translation file always wins. That means that you need to make
158-
sure that the bundle containing *your* translations is loaded after any
157+
Translation files are not aware of :doc:`bundle inheritance </bundles/inheritance>`.
158+
If you want to override translations from the parent bundle or another bundle,
159+
make sure that the bundle containing *your* translations is loaded after any
159160
bundle whose translations you're overriding. This is done in ``AppKernel``.
160161

161-
Translation files are also not aware of :doc:`bundle inheritance </bundles/inheritance>`.
162-
If you want to override translations from the parent bundle, be sure that the
163-
parent bundle is loaded before the child bundle in the ``AppKernel`` class.
164-
165-
The file that always wins is the one that is placed in
166-
``app/Resources/translations``, as those files are always loaded last.
162+
Finally, translations located in ``app/Resources/translations`` will override
163+
all the other translations since those files are always loaded last.
167164
.. _`the Doctrine documentation`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#overrides

‎components/cache/cache_pools.rst

Copy file name to clipboardExpand all lines: components/cache/cache_pools.rst
+54Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,25 @@ contents as regular files in a set of directories on the local file system::
5858
$directory = null
5959
);
6060

61+
Php Files Cache Adapter
62+
~~~~~~~~~~~~~~~~~~~~~~~
63+
64+
This adapter is very similar to the Filesystem adapter, except that the saving creates
65+
a ``.php`` file, which is included on fetch (allowing the file to be saved in OPcache)::
66+
67+
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
68+
69+
$cache = new PhpFilesAdapter(
70+
// the subdirectory of the main cache directory where cache items are stored
71+
$namespace = '',
72+
// in seconds; applied to cache items that don't define their own lifetime
73+
// 0 means to store the cache items indefinitely (i.e. until the files are deleted)
74+
$defaultLifetime = 0,
75+
// the main cache directory (the application needs read-write permissions on it)
76+
// if none is specified, a directory is created inside the system temporary directory
77+
$directory = null
78+
);
79+
6180
APCu Cache Adapter
6281
~~~~~~~~~~~~~~~~~~
6382

@@ -189,6 +208,41 @@ This adapter also defines two optional arguments called ``namespace`` (default:
189208
``''``) and ``defaultLifetime`` (default: ``0``) and adapts them to make them
190209
work in the underlying Doctrine cache.
191210

211+
Php Array Cache Adapter
212+
~~~~~~~~~~~~~~~~~~~~~~~
213+
214+
This adapter is a highly performant way to cache static data (e.g. application configuration)
215+
that is optimized and preloaded into OPcache memory storage::
216+
217+
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
218+
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
219+
220+
// somehow, decide it's time to warm up the cache!
221+
if ($needsWarmup) {
222+
// some static values
223+
$values = array(
224+
'stats.num_products' => 4711,
225+
'stats.num_users' => 1356,
226+
);
227+
228+
$cache = new PhpArrayAdapter(
229+
// single file where values are cached
230+
__DIR__ . '/somefile.cache',
231+
// a backup adapter, if you set values after warmup
232+
new FilesystemAdapter()
233+
);
234+
$cache->warmUp($values);
235+
}
236+
237+
// ... then, use the cache!
238+
$cacheItem = $cache->getItem('stats.num_users');
239+
echo $cacheItem->get();
240+
241+
.. note::
242+
243+
This adapter requires PHP 7.x and should be used with the php.ini setting
244+
``opcache.enable`` on.
245+
192246
Looking for Cache Items
193247
-----------------------
194248

‎components/class_loader.rst

Copy file name to clipboardExpand all lines: components/class_loader.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ The ClassLoader Component
77
The ClassLoader component provides tools to autoload your classes and
88
cache their locations for performance.
99

10+
.. caution::
11+
12+
The ClassLoader component was deprecated in Symfony 3.3 and it will be
13+
removed in 4.0. As an alternative, use Composer's class loading mechanism.
14+
1015
Usage
1116
-----
1217

‎components/http_foundation/trusting_proxies.rst

Copy file name to clipboardExpand all lines: components/http_foundation/trusting_proxies.rst
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@ the actual host may be stored in an ``X-Forwarded-Host`` header.
1717

1818
Since HTTP headers can be spoofed, Symfony does *not* trust these proxy
1919
headers by default. If you are behind a proxy, you should manually whitelist
20-
your proxy.
20+
your proxy as follows:
2121

2222
.. code-block:: php
2323
2424
use Symfony\Component\HttpFoundation\Request;
2525
26-
// only trust proxy headers coming from this IP addresses
26+
// put this code as early as possible in your application (e.g. in your
27+
// front controller) to only trust proxy headers coming from these IP addresses
2728
Request::setTrustedProxies(array('192.0.0.1', '10.0.0.0/8'));
2829
30+
.. versionadded:: 2.3
31+
CIDR notation support was introduced in Symfony 2.3, so you can whitelist whole
32+
subnets (e.g. ``10.0.0.0/8``, ``fc00::/7``).
33+
2934
You should also make sure that your proxy filters unauthorized use of these
3035
headers, e.g. if a proxy natively uses the ``X-Forwarded-For`` header, it
3136
should not allow clients to send ``Forwarded`` headers to Symfony.

‎frontend/custom_version_strategy.rst

Copy file name to clipboardExpand all lines: frontend/custom_version_strategy.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ version string::
100100
return $versionized;
101101
}
102102

103-
private function loadManifest(array $options)
103+
private function loadManifest()
104104
{
105105
return json_decode(file_get_contents($this->manifestPath), true);
106106
}

‎reference/configuration/doctrine.rst

Copy file name to clipboardExpand all lines: reference/configuration/doctrine.rst
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,9 @@ certain classes, but those are for very advanced use-cases only.
297297
Caching Drivers
298298
~~~~~~~~~~~~~~~
299299

300-
For the caching drivers you can specify the values ``array``, ``apc``, ``memcache``,
301-
``memcached``, ``redis``, ``wincache``, ``zenddata``, ``xcache`` or ``service``.
300+
For the caching drivers you can specify the values ``array``, ``apc``, ``apcu``,
301+
``memcache``, ``memcached``, ``redis``, ``wincache``, ``zenddata``, ``xcache``
302+
or ``service``.
302303

303304
The following example shows an overview of the caching configurations:
304305

‎reference/constraints/Count.rst

Copy file name to clipboardExpand all lines: reference/constraints/Count.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ you might add the following:
3838
{
3939
/**
4040
* @Assert\Count(
41-
* min = "1",
42-
* max = "5",
41+
* min = 1,
42+
* max = 5,
4343
* minMessage = "You must specify at least one email",
4444
* maxMessage = "You cannot specify more than {{ limit }} emails"
4545
* )

‎security/guard_authentication.rst

Copy file name to clipboardExpand all lines: security/guard_authentication.rst
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,10 @@ Frequently Asked Questions
502502
logout: ~
503503
504504
guard:
505+
entry_point: app.form_login_authenticator
505506
authenticators:
506507
- app.token_authenticator
508+
- app.form_login_authenticator
507509
508510
# if you want, disable storing the user in the session
509511
# stateless: true
@@ -529,8 +531,9 @@ Frequently Asked Questions
529531
>
530532
<logout />
531533
532-
<guard>
534+
<guard entry-point="app.form_login_authenticator">
533535
<authenticator>app.token_authenticator</authenticator>
536+
<authenticator>app.form_login_authenticator</authenticator>
534537
</guard>
535538
536539
<!-- ... -->
@@ -551,8 +554,10 @@ Frequently Asked Questions
551554
'anonymous' => true,
552555
'logout' => true,
553556
'guard' => array(
557+
'entry_point' => 'app.form_login_authenticator',
554558
'authenticators' => array(
555-
'app.token_authenticator'
559+
'app.token_authenticator',
560+
'app.form_login_authenticator',
556561
),
557562
),
558563
// ...

‎service_container.rst

Copy file name to clipboardExpand all lines: service_container.rst
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,29 @@ Injecting the dependency by the setter method just needs a change of syntax:
462462
and "setter injection". The Symfony service container also supports
463463
"property injection".
464464

465+
.. tip::
466+
467+
The YAML configuration format supports an expanded syntax which may be
468+
useful when the YAML contents are long and complex:
469+
470+
.. code-block:: yaml
471+
472+
# app/config/services.yml
473+
services:
474+
# traditional syntax
475+
app.newsletter_manager:
476+
class: AppBundle\Newsletter\NewsletterManager
477+
calls:
478+
- [setMailer, ['@app.mailer']]
479+
480+
# expanded syntax
481+
app.newsletter_manager:
482+
class: AppBundle\Newsletter\NewsletterManager
483+
calls:
484+
- method: setMailer
485+
arguments:
486+
- '@app.mailer'
487+
465488
Learn more
466489
----------
467490

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.