Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit0e3f25b

Browse files
committed
Merge branch '2.8'
2 parents1b91720 +f8c9ce3 commit0e3f25b

File tree

7 files changed

+30
-18
lines changed

7 files changed

+30
-18
lines changed

‎components/options_resolver.rst‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ that, you can write normalizers. Normalizers are executed after validating an
427427
option. You can configure a normalizer by calling
428428
:method:`Symfony\\Component\\OptionsResolver\\OptionsResolver::setNormalizer`::
429429

430+
use Symfony\Component\OptionsResolver\Options;
431+
430432
// ...
431433
class Mailer
432434
{
@@ -436,7 +438,7 @@ option. You can configure a normalizer by calling
436438
{
437439
// ...
438440

439-
$resolver->setNormalizer('host', function ($options, $value) {
441+
$resolver->setNormalizer('host', function (Options$options, $value) {
440442
if ('http://' !== substr($value, 0, 7)) {
441443
$value = 'http://'.$value;
442444
}
@@ -462,7 +464,7 @@ if you need to use other options during normalization::
462464
public function configureOptions(OptionsResolver $resolver)
463465
{
464466
// ...
465-
$resolver->setNormalizer('host', function ($options, $value) {
467+
$resolver->setNormalizer('host', function (Options$options, $value) {
466468
if (!in_array(substr($value, 0, 7), array('http://', 'https://'))) {
467469
if ('ssl' === $options['encryption']) {
468470
$value = 'https://'.$value;

‎components/routing/introduction.rst‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ your autoloader to load the Routing component::
4848

4949
..note::
5050

51-
Be careful when using ``$_SERVER['REQUEST_URI']``, as it may include
52-
any query parameters on the URL, which will cause problems with route
53-
matching. An easy way to solve this is to use the HttpFoundation component
54-
as explained:ref:`below<components-routing-http-foundation>`.
51+
The:class:`Symfony\\Component\\Routing\\RequestContext` parameters can be populated
52+
with the values stored in ``$_SERVER``, but it's easier to use the HttpFoundation
53+
component as explained:ref:`below<components-routing-http-foundation>`.
5554

5655
You can add as many routes as you like to a
5756
:class:`Symfony\\Component\\Routing\\RouteCollection`.

‎components/translation/custom_formats.rst‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ will save a few lines::
8585

8686
class MyFormatDumper extends FileDumper
8787
{
88-
protected functionformat(MessageCatalogue $messages, $domain = 'messages')
88+
public functionformatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
8989
{
9090
$output = '';
9191

@@ -102,7 +102,16 @@ will save a few lines::
102102
}
103103
}
104104

105-
The:method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::format`
105+
..sidebar::Format a message catalogue
106+
107+
..versionadded::2.8
108+
The ability to format a message catalogue without dumping it was introduced in Symfony 2.8.
109+
110+
In some cases, you want to send the dump contents as a response instead of writing them in files.
111+
To do this, you can use the ``formatCatalogue`` method. In this case, you must pass the domain argument,
112+
which determines the list of messages that should be dumped.
113+
114+
The:method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::formatCatalogue`
106115
method creates the output string, that will be used by the
107116
:method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::dump` method
108117
of the FileDumper class to create the file. The dumper can be used like any other
@@ -116,4 +125,3 @@ YAML file are dumped into a text file with the custom format::
116125

117126
$dumper = new MyFormatDumper();
118127
$dumper->dump($catalogue, array('path' => __DIR__.'/dumps'));
119-

‎cookbook/controller/upload_file.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ in the ``Product`` entity::
4949
Note that the type of the ``brochure`` column is ``string`` instead of ``binary``
5050
or ``blob`` because it just stores the PDF file name instead of the file contents.
5151

52-
Then, add a new ``brochure`` field to the form thatmanage the ``Product`` entity::
52+
Then, add a new ``brochure`` field to the form thatmanages the ``Product`` entity::
5353

5454
// src/AppBundle/Form/ProductType.php
5555
namespace AppBundle\Form;
@@ -133,7 +133,7 @@ Finally, you need to update the code of the controller that handles the form::
133133

134134
// Update the 'brochure' property to store the PDF file name
135135
// instead of its contents
136-
$product->setBrochure($filename);
136+
$product->setBrochure($fileName);
137137

138138
// ... persist the $product variable or any other work
139139

‎cookbook/security/remember_me.rst‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
2222
default:
2323
# ...
2424
remember_me:
25-
key:"%secret%"
25+
secret:"%secret%"
2626
lifetime:604800# 1 week in seconds
2727
path:/
2828
# by default, the feature is enabled by checking a
@@ -48,7 +48,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
4848
4949
<!-- 604800 is 1 week in seconds-->
5050
<remember-me
51-
key="%secret%"
51+
secret="%secret%"
5252
lifetime="604800"
5353
path="/" />
5454
<!-- by default, the feature is enabled by checking a checkbox
@@ -68,7 +68,7 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
6868
'default' => array(
6969
// ...
7070
'remember_me' => array(
71-
'key' => '%secret%',
71+
'secret' => '%secret%',
7272
'lifetime' => 604800, // 1 week in seconds
7373
'path' => '/',
7474
// by default, the feature is enabled by checking a
@@ -82,7 +82,10 @@ the session lasts using a cookie with the ``remember_me`` firewall option:
8282
8383
The ``remember_me`` firewall defines the following configuration options:
8484

85-
``key`` (**required**)
85+
``secret`` (**required**)
86+
..versionadded::2.8
87+
Prior to Symfony 2.8, the ``secret`` option was named ``key``.
88+
8689
The value used to encrypt the cookie's content. It's common to use the
8790
``secret`` value defined in the ``app/config/parameters.yml`` file.
8891

‎reference/configuration/framework.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ This determines whether cookies should only be sent over secure connections.
774774
cookie_httponly
775775
...............
776776

777-
**type**: ``boolean`` **default**: ``false``
777+
**type**: ``boolean`` **default**: ``true``
778778

779779
This determines whether cookies should only be accessible through the HTTP
780780
protocol. This means that the cookie won't be accessible by scripting

‎reference/configuration/security.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Each part will be explained in the next section.
180180
181181
remember_me:
182182
token_provider:name
183-
key:someS3cretKey
183+
secret:someS3cretKey
184184
name:NameOfTheCookie
185185
lifetime:3600# in seconds
186186
path:/foo
@@ -227,7 +227,7 @@ Each part will be explained in the next section.
227227
domain:~
228228
handlers:[]
229229
anonymous:
230-
key:4f954a0667e01
230+
secret:4f954a0667e01
231231
switch_user:
232232
provider:~
233233
parameter:_switch_user

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp