Skip to content

Commit f2b48c7

Browse files
committed
Merge branch '2.1' into 2.2
Conflicts: components/http_foundation/introduction.rst cookbook/form/dynamic_form_modification.rst
2 parents 8e66c04 + c1c4424 commit f2b48c7

File tree

7 files changed

+310
-166
lines changed

7 files changed

+310
-166
lines changed

‎book/installation.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,13 @@ Symfony itself - into the ``vendor/`` directory.
172172
When running ``php composer.phar install`` or ``php composer.phar update``,
173173
composer will execute post install/update commands to clear the cache
174174
and install assets. By default, the assets will be copied into your ``web``
175-
directory. To create symlinks instead of copying the assets, you can
176-
add an entry in the ``extra`` node of your composer.json file with the
177-
key ``symfony-assets-install`` and the value ``symlink``:
175+
directory.
176+
177+
Instead of copying your Symfony assets, you can create symlinks if
178+
your operating system supports it. To create symlinks, add an entry
179+
in the ``extra`` node of your composer.json file with the key
180+
``symfony-assets-install`` and the value ``symlink``:
181+
178182

179183
.. code-block:: json
180184

‎book/templating.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,8 +1344,13 @@ is being escaped for HTML output.
13441344
In some cases, you'll need to disable output escaping when you're rendering
13451345
a variable that is trusted and contains markup that should not be escaped.
13461346
Suppose that administrative users are able to write articles that contain
1347-
HTML code. By default, Twig will escape the article body. To render it normally,
1348-
add the ``raw`` filter: ``{{ article.body|raw }}``.
1347+
HTML code. By default, Twig will escape the article body.
1348+
1349+
To render it normally, add the ``raw`` filter:
1350+
1351+
.. code-block:: jinja
1352+
1353+
{{ article.body|raw }}
13491354
13501355
You can also disable output escaping inside a ``{% block %}`` area or
13511356
for an entire template. For more information, see `Output Escaping`_ in

‎components/http_foundation/introduction.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@ represented by a PHP callable instead of a string::
406406
});
407407
$response->send();
408408

409+
.. note::
410+
411+
The ``flush()`` function does not flush buffering. If ``ob_start()`` has
412+
been called before or the ``output_buffering`` php.ini option is enabled,
413+
you must call ``ob_flush()`` before ``flush()``.
414+
415+
Additionally, PHP isn't the only layer that can buffer output. Your web
416+
server might also buffer based on its configuration. Even more, if you
417+
use fastcgi, buffering can't be disabled at all.
418+
409419
.. _component-http-foundation-serving-files:
410420

411421
Serving Files

‎components/process.rst

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@ a command in a sub-process::
2626
$process = new Process('ls -lsa');
2727
$process->setTimeout(3600);
2828
$process->run();
29+
30+
// executes after the the command finishes
2931
if (!$process->isSuccessful()) {
3032
throw new \RuntimeException($process->getErrorOutput());
3133
}
3234

3335
print $process->getOutput();
3436

35-
The :method:`Symfony\\Component\\Process\\Process::run` method takes care
36-
of the subtle differences between the different platforms when executing the
37-
command.
37+
The component takes care of the subtle differences between the different platforms
38+
when executing the command.
3839

3940
.. versionadded:: 2.2
4041
The ``getIncrementalOutput()`` and ``getIncrementalErrorOutput()`` methods were added in Symfony 2.2.
@@ -60,6 +61,41 @@ anonymous function to the
6061
echo 'OUT > '.$buffer;
6162
}
6263
});
64+
65+
.. versionadded:: 2.1
66+
The non-blocking feature was added in 2.1.
67+
68+
You can also start the subprocess and then let it run asynchronously, retrieving
69+
output and the status in your main process whenever you need it. Use the
70+
:method:`Symfony\\Component\\Process\\Process::start` method to start an asynchronous
71+
process, the :method:`Symfony\\Component\\Process\\Process::isRunning` method
72+
to check if the process is done and the
73+
:method:`Symfony\\Component\\Process\\Process::getOutput` method to get the output::
74+
75+
$process = new Process('ls -lsa');
76+
$process->start();
77+
78+
while ($process->isRunning()) {
79+
// waiting for process to finish
80+
}
81+
82+
echo $process->getOutput();
83+
84+
You can also wait for a process to end if you started it asynchronously and
85+
are done doing other stuff::
86+
87+
$process = new Process('ls -lsa');
88+
$process->start();
89+
90+
// do other things
91+
92+
$process->wait(function ($type, $buffer) {
93+
if ('err' === $type) {
94+
echo 'ERR > '.$buffer;
95+
} else {
96+
echo 'OUT > '.$buffer;
97+
}
98+
});
6399

64100
If you want to execute some PHP code in isolation, use the ``PhpProcess``
65101
instead::
@@ -73,7 +109,7 @@ instead::
73109
$process->run();
74110

75111
.. versionadded:: 2.1
76-
The ``ProcessBuilder`` class has been as of 2.1.
112+
The ``ProcessBuilder`` class was added in Symfony 2.1.
77113

78114
To make your code work better on all platforms, you might want to use the
79115
:class:`Symfony\\Component\\Process\\ProcessBuilder` class instead::

‎cookbook/form/create_custom_field_type.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ But this only works because the ``GenderType()`` is very simple. What if
207207
the gender codes were stored in configuration or in a database? The next
208208
section explains how more complex field types solve this problem.
209209

210+
.. _form-cookbook-form-field-service:
211+
210212
Creating your Field Type as a Service
211213
-------------------------------------
212214

0 commit comments

Comments
 (0)