Skip to content

Commit 1b91720

Browse files
committed
Merge branch '2.8'
2 parents 194f5cc + 3ffe2e5 commit 1b91720

File tree

21 files changed

+274
-149
lines changed

21 files changed

+274
-149
lines changed

_theme/_templates/layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<div id="demo-warning">
4747
<h4>Pull request build</h4>
4848
<p>Each pull request of the Symfony Documentation is automatically deployed and hosted on <a href="https://platform.sh">Platform.sh</a>.<br>
49-
Visit the page on <a href="https://symfony.com/doc/current/{{ pagename }}">symfony.com</a>.</p>
49+
View this page on <a href="https://symfony.com/doc/current/{{ pagename }}">symfony.com</a>.</p>
5050
</div>
5151

5252
{%- include "globaltoc.html" %}

book/controller.rst

+13-5
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,8 @@ session.
619619
Flash Messages
620620
~~~~~~~~~~~~~~
621621

622-
You can also store small messages that will be stored on the user's session
623-
for exactly one additional request. This is useful when processing a form:
622+
You can also store small messages that will be stored on the user's session.
623+
This is useful when processing a form:
624624
you want to redirect and have a special message shown on the *next* page.
625625
These types of messages are called "flash" messages.
626626

@@ -675,9 +675,17 @@ the ``notice`` message:
675675
</div>
676676
<?php endforeach ?>
677677

678-
By design, flash messages are meant to live for exactly one request (they're
679-
"gone in a flash"). They're designed to be used across redirects exactly as
680-
you've done in this example.
678+
.. note::
679+
680+
By design, flash messages are meant to be processed exactly once. This means
681+
that they vanish from the session automatically when they are retrieved from
682+
the flash bag by calling the ``get()`` method.
683+
684+
.. tip::
685+
686+
You can use the
687+
:method:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface::peek`
688+
method instead to retrieve the message while keeping it in the bag.
681689

682690
.. index::
683691
single: Controller; Response object

book/forms.rst

+10-2
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,21 @@ controller::
232232
$form->handleRequest($request);
233233

234234
if ($form->isValid()) {
235-
// perform some action, such as saving the task to the database
235+
// ... perform some action, such as saving the task to the database
236236

237237
return $this->redirectToRoute('task_success');
238238
}
239239

240-
// ...
240+
return $this->render('default/new.html.twig', array(
241+
'form' => $form->createView(),
242+
));
241243
}
244+
245+
.. caution::
246+
247+
Be aware that the ``createView()`` method should be called *after* ``handleRequest``
248+
is called. Otherwise, changes done in the ``*_SUBMIT`` events aren't applied to the
249+
view (like validation errors).
242250

243251
.. versionadded:: 2.3
244252
The :method:`Symfony\\Component\\Form\\FormInterface::handleRequest` method

book/installation.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ If there are any issues, correct them now before moving on.
239239
$ rm -rf app/cache/*
240240
$ rm -rf app/logs/*
241241
242-
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
242+
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
243243
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
244244
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
245245
@@ -254,7 +254,7 @@ If there are any issues, correct them now before moving on.
254254

255255
.. code-block:: bash
256256
257-
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
257+
$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
258258
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
259259
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs
260260

components/console/introduction.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ Coloring the Output
143143
By default, the Windows command console doesn't support output coloring. The
144144
Console component disables output coloring for Windows systems, but if your
145145
commands invoke other scripts which emit color sequences, they will be
146-
wrongly displayed as raw escape characters. Install the `ConEmu`_ or `ANSICON`_
147-
free applications to add coloring support to your Windows command console.
146+
wrongly displayed as raw escape characters. Install the `ConEmu`_, `ANSICON`_
147+
or `Mintty`_ (used by default in GitBash and Cygwin) free applications
148+
to add coloring support to your Windows command console.
148149

149150
Whenever you output text, you can surround the text with tags to color its
150151
output. For example::
@@ -582,3 +583,4 @@ Learn More!
582583
.. _Packagist: https://packagist.org/packages/symfony/console
583584
.. _ConEmu: https://code.google.com/p/conemu-maximus5/
584585
.. _ANSICON: https://github.com/adoxa/ansicon/releases
586+
.. _Mintty: https://mintty.github.io/

components/options_resolver.rst

+19-19
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ It's a good practice to split the option configuration into a separate method::
173173
$this->options = $resolver->resolve($options);
174174
}
175175

176-
protected function configureOptions(OptionsResolver $resolver)
176+
public function configureOptions(OptionsResolver $resolver)
177177
{
178178
$resolver->setDefaults(array(
179179
'host' => 'smtp.example.org',
@@ -192,7 +192,7 @@ than processing options. Second, sub-classes may now override the
192192
// ...
193193
class GoogleMailer extends Mailer
194194
{
195-
protected function configureOptions(OptionsResolver $resolver)
195+
public function configureOptions(OptionsResolver $resolver)
196196
{
197197
parent::configureOptions($resolver);
198198

@@ -215,7 +215,7 @@ For example, to make the ``host`` option required, you can do::
215215
{
216216
// ...
217217

218-
protected function configureOptions(OptionsResolver $resolver)
218+
public function configureOptions(OptionsResolver $resolver)
219219
{
220220
// ...
221221
$resolver->setRequired('host');
@@ -243,7 +243,7 @@ one required option::
243243
{
244244
// ...
245245

246-
protected function configureOptions(OptionsResolver $resolver)
246+
public function configureOptions(OptionsResolver $resolver)
247247
{
248248
// ...
249249
$resolver->setRequired(array('host', 'username', 'password'));
@@ -263,7 +263,7 @@ retrieve the names of all required options::
263263
// ...
264264
class GoogleMailer extends Mailer
265265
{
266-
protected function configureOptions(OptionsResolver $resolver)
266+
public function configureOptions(OptionsResolver $resolver)
267267
{
268268
parent::configureOptions($resolver);
269269

@@ -291,7 +291,7 @@ been set::
291291
{
292292
// ...
293293

294-
protected function configureOptions(OptionsResolver $resolver)
294+
public function configureOptions(OptionsResolver $resolver)
295295
{
296296
// ...
297297
$resolver->setRequired('host');
@@ -301,7 +301,7 @@ been set::
301301
// ...
302302
class GoogleMailer extends Mailer
303303
{
304-
protected function configureOptions(OptionsResolver $resolver)
304+
public function configureOptions(OptionsResolver $resolver)
305305
{
306306
parent::configureOptions($resolver);
307307

@@ -336,7 +336,7 @@ correctly. To validate the types of the options, call
336336
{
337337
// ...
338338

339-
protected function configureOptions(OptionsResolver $resolver)
339+
public function configureOptions(OptionsResolver $resolver)
340340
{
341341
// ...
342342
$resolver->setAllowedTypes('host', 'string');
@@ -381,7 +381,7 @@ to verify that the passed option contains one of these values::
381381
{
382382
// ...
383383

384-
protected function configureOptions(OptionsResolver $resolver)
384+
public function configureOptions(OptionsResolver $resolver)
385385
{
386386
// ...
387387
$resolver->setDefault('transport', 'sendmail');
@@ -432,7 +432,7 @@ option. You can configure a normalizer by calling
432432
{
433433
// ...
434434

435-
protected function configureOptions(OptionsResolver $resolver)
435+
public function configureOptions(OptionsResolver $resolver)
436436
{
437437
// ...
438438

@@ -459,7 +459,7 @@ if you need to use other options during normalization::
459459
class Mailer
460460
{
461461
// ...
462-
protected function configureOptions(OptionsResolver $resolver)
462+
public function configureOptions(OptionsResolver $resolver)
463463
{
464464
// ...
465465
$resolver->setNormalizer('host', function ($options, $value) {
@@ -493,7 +493,7 @@ these options, you can return the desired default value::
493493
class Mailer
494494
{
495495
// ...
496-
protected function configureOptions(OptionsResolver $resolver)
496+
public function configureOptions(OptionsResolver $resolver)
497497
{
498498
// ...
499499
$resolver->setDefault('encryption', null);
@@ -525,7 +525,7 @@ the closure::
525525
class Mailer
526526
{
527527
// ...
528-
protected function configureOptions(OptionsResolver $resolver)
528+
public function configureOptions(OptionsResolver $resolver)
529529
{
530530
// ...
531531
$resolver->setDefaults(array(
@@ -537,7 +537,7 @@ the closure::
537537

538538
class GoogleMailer extends Mailer
539539
{
540-
protected function configureOptions(OptionsResolver $resolver)
540+
public function configureOptions(OptionsResolver $resolver)
541541
{
542542
parent::configureOptions($resolver);
543543

@@ -568,7 +568,7 @@ comes from the default::
568568
class Mailer
569569
{
570570
// ...
571-
protected function configureOptions(OptionsResolver $resolver)
571+
public function configureOptions(OptionsResolver $resolver)
572572
{
573573
// ...
574574
$resolver->setDefault('port', 25);
@@ -600,7 +600,7 @@ be included in the resolved options if it was actually passed to
600600
{
601601
// ...
602602

603-
protected function configureOptions(OptionsResolver $resolver)
603+
public function configureOptions(OptionsResolver $resolver)
604604
{
605605
// ...
606606
$resolver->setDefined('port');
@@ -634,7 +634,7 @@ options in one go::
634634
class Mailer
635635
{
636636
// ...
637-
protected function configureOptions(OptionsResolver $resolver)
637+
public function configureOptions(OptionsResolver $resolver)
638638
{
639639
// ...
640640
$resolver->setDefined(array('port', 'encryption'));
@@ -655,7 +655,7 @@ let you find out which options are defined::
655655
{
656656
// ...
657657

658-
protected function configureOptions(OptionsResolver $resolver)
658+
public function configureOptions(OptionsResolver $resolver)
659659
{
660660
parent::configureOptions($resolver);
661661

@@ -701,7 +701,7 @@ can change your code to do the configuration only once per class::
701701
$this->options = self::$resolversByClass[$class]->resolve($options);
702702
}
703703

704-
protected function configureOptions(OptionsResolver $resolver)
704+
public function configureOptions(OptionsResolver $resolver)
705705
{
706706
// ...
707707
}

components/var_dumper/introduction.rst

+9-28
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ use instead of e.g. :phpfunction:`var_dump`. By using it, you'll gain:
4242
For example::
4343

4444
require __DIR__.'/vendor/autoload.php';
45+
4546
// create a variable, which could be anything!
46-
$someVar = '...';
47+
$someVar = ...;
4748

4849
dump($someVar);
4950

@@ -70,14 +71,14 @@ current PHP SAPI:
7071
#. Run ``composer global require symfony/var-dumper``;
7172
#. Add ``auto_prepend_file = ${HOME}/.composer/vendor/autoload.php``
7273
to your ``php.ini`` file;
73-
#. From time to time, run ``composer global update`` to have the latest
74-
bug fixes.
74+
#. From time to time, run ``composer global update symfony/var-dumper``
75+
to have the latest bug fixes.
7576

7677
DebugBundle and Twig Integration
7778
--------------------------------
7879

79-
The ``DebugBundle`` allows greater integration of the component into the
80-
Symfony full stack framework. It is enabled by default in the *dev* and *test*
80+
The DebugBundle allows greater integration of the component into the Symfony
81+
full-stack framework. It is enabled by default in the *dev* and *test*
8182
environment of the standard edition since version 2.6.
8283

8384
Since generating (even debug) output in the controller or in the model
@@ -98,29 +99,9 @@ Choosing between both is mostly a matter of personal taste, still:
9899
be suited to your use case (e.g. you shouldn't use it in an HTML
99100
attribute or a ``<script>`` tag).
100101

101-
By default for nested variables, dumps are limited to a subset of their
102-
original value. You can configure the limits in terms of:
103-
104-
* maximum number of items to dump,
105-
* maximum string length before truncation.
106-
107-
.. configuration-block::
108-
109-
.. code-block:: yaml
110-
111-
debug:
112-
max_items: 250
113-
max_string_length: -1
114-
115-
.. code-block:: xml
116-
117-
<?xml version="1.0" encoding="UTF-8" ?>
118-
<container xmlns="http://symfony.com/schema/dic/debug"
119-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
120-
xsi:schemaLocation="http://symfony.com/schema/dic/debug http://symfony.com/schema/dic/debug/debug-1.0.xsd">
121-
122-
<config max-items="250" max-string-length="-1" />
123-
</container>
102+
This behavior can be changed by configuring the ``dump.dump_destination``
103+
option. Read more about this and other options in
104+
:doc:`the DebugBundle configuration reference </reference/configuration/debug>`.
124105

125106
Using the VarDumper Component in your PHPUnit Test Suite
126107
--------------------------------------------------------

contributing/code/tests.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ what's going on and if the tests are broken because of the new code.
5151
5252
.. tip::
5353

54-
On Windows, install the `ConEmu`_ or `ANSICON`_ free applications to see
55-
colored test results.
54+
On Windows, install the `ConEmu`_, `ANSICON`_ or `Mintty`_ free applications
55+
to see colored test results.
5656

5757
.. _ConEmu: https://code.google.com/p/conemu-maximus5/
5858
.. _ANSICON: https://github.com/adoxa/ansicon/releases
59+
.. _Mintty: https://mintty.github.io/

contributing/documentation/overview.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ page on GitHub and click on ``Details``.
269269
``.platform.app.yaml``, ``.platform/services.yaml`` and
270270
``.platform/routes.yaml`` allow `Platform.sh`_ to build Pull Requests.
271271

272+
.. note::
273+
274+
Only Pull Requests to maintained branches are automatically built by
275+
Platform.sh. Check the `roadmap`_ for maintained branches.
276+
272277
Minor Changes (e.g. Typos)
273278
--------------------------
274279

@@ -345,4 +350,5 @@ definitely don't want you to waste your time!
345350
.. _SensioLabsConnect: https://connect.sensiolabs.com/
346351
.. _`Symfony Documentation Badge`: https://connect.sensiolabs.com/badge/36/symfony-documentation-contributor
347352
.. _`sync your fork`: https://help.github.com/articles/syncing-a-fork
348-
.. _`Platform.sh`: https://platform.sh
353+
.. _`Platform.sh`: https://platform.sh
354+
.. _`roadmap`: https://symfony.com/roadmap

0 commit comments

Comments
 (0)