Permalink
Browse files

Merge branch '2.1' into 2.2

Conflicts:
	components/http_foundation/introduction.rst
	cookbook/form/dynamic_form_modification.rst
  • Loading branch information...
2 parents 8e66c04 + c1c4424 commit f2b48c770ee270c9bc4caed86345cefd7eb4f004 @weaverryan weaverryan committed Apr 4, 2013
View
@@ -172,9 +172,13 @@ Symfony itself - into the ``vendor/`` directory.
When running ``php composer.phar install`` or ``php composer.phar update``,
composer will execute post install/update commands to clear the cache
and install assets. By default, the assets will be copied into your ``web``
- directory. To create symlinks instead of copying the assets, you can
- add an entry in the ``extra`` node of your composer.json file with the
- key ``symfony-assets-install`` and the value ``symlink``:
+ directory.
+
+ Instead of copying your Symfony assets, you can create symlinks if
+ your operating system supports it. To create symlinks, add an entry
+ in the ``extra`` node of your composer.json file with the key
+ ``symfony-assets-install`` and the value ``symlink``:
+
.. code-block:: json
View
@@ -1344,8 +1344,13 @@ is being escaped for HTML output.
In some cases, you'll need to disable output escaping when you're rendering
a variable that is trusted and contains markup that should not be escaped.
Suppose that administrative users are able to write articles that contain
-HTML code. By default, Twig will escape the article body. To render it normally,
-add the ``raw`` filter: ``{{ article.body|raw }}``.
+HTML code. By default, Twig will escape the article body.
+
+To render it normally, add the ``raw`` filter:
+
+.. code-block:: jinja
+
+ {{ article.body|raw }}
You can also disable output escaping inside a ``{% block %}`` area or
for an entire template. For more information, see `Output Escaping`_ in
@@ -406,6 +406,16 @@ represented by a PHP callable instead of a string::
});
$response->send();
+.. note::
+
+ The ``flush()`` function does not flush buffering. If ``ob_start()`` has
+ been called before or the ``output_buffering`` php.ini option is enabled,
+ you must call ``ob_flush()`` before ``flush()``.
+
+ Additionally, PHP isn't the only layer that can buffer output. Your web
+ server might also buffer based on its configuration. Even more, if you
+ use fastcgi, buffering can't be disabled at all.
+
.. _component-http-foundation-serving-files:
Serving Files
View
@@ -26,15 +26,16 @@ a command in a sub-process::
$process = new Process('ls -lsa');
$process->setTimeout(3600);
$process->run();
+
+ // executes after the the command finishes
if (!$process->isSuccessful()) {
throw new \RuntimeException($process->getErrorOutput());
}
print $process->getOutput();
-The :method:`Symfony\\Component\\Process\\Process::run` method takes care
-of the subtle differences between the different platforms when executing the
-command.
+The component takes care of the subtle differences between the different platforms
+when executing the command.
.. versionadded:: 2.2
The ``getIncrementalOutput()`` and ``getIncrementalErrorOutput()`` methods were added in Symfony 2.2.
@@ -60,6 +61,41 @@ anonymous function to the
echo 'OUT > '.$buffer;
}
});
+
+.. versionadded:: 2.1
+ The non-blocking feature was added in 2.1.
+
+You can also start the subprocess and then let it run asynchronously, retrieving
+output and the status in your main process whenever you need it. Use the
+:method:`Symfony\\Component\\Process\\Process::start` method to start an asynchronous
+process, the :method:`Symfony\\Component\\Process\\Process::isRunning` method
+to check if the process is done and the
+:method:`Symfony\\Component\\Process\\Process::getOutput` method to get the output::
+
+ $process = new Process('ls -lsa');
+ $process->start();
+
+ while ($process->isRunning()) {
+ // waiting for process to finish
+ }
+
+ echo $process->getOutput();
+
+You can also wait for a process to end if you started it asynchronously and
+are done doing other stuff::
+
+ $process = new Process('ls -lsa');
+ $process->start();
+
+ // do other things
+
+ $process->wait(function ($type, $buffer) {
+ if ('err' === $type) {
+ echo 'ERR > '.$buffer;
+ } else {
+ echo 'OUT > '.$buffer;
+ }
+ });
If you want to execute some PHP code in isolation, use the ``PhpProcess``
instead::
@@ -73,7 +109,7 @@ instead::
$process->run();
.. versionadded:: 2.1
- The ``ProcessBuilder`` class has been as of 2.1.
+ The ``ProcessBuilder`` class was added in Symfony 2.1.
To make your code work better on all platforms, you might want to use the
:class:`Symfony\\Component\\Process\\ProcessBuilder` class instead::
@@ -207,6 +207,8 @@ But this only works because the ``GenderType()`` is very simple. What if
the gender codes were stored in configuration or in a database? The next
section explains how more complex field types solve this problem.
+.. _form-cookbook-form-field-service:
+
Creating your Field Type as a Service
-------------------------------------
Oops, something went wrong.

0 comments on commit f2b48c7

Please sign in to comment.