Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch '2.1' into 2.2
Conflicts:
	components/http_foundation/introduction.rst
	cookbook/form/dynamic_form_modification.rst
  • Loading branch information
weaverryan committed Apr 4, 2013
2 parents 8e66c04 + c1c4424 commit f2b48c7
Show file tree
Hide file tree
Showing 7 changed files with 310 additions and 166 deletions.
10 changes: 7 additions & 3 deletions book/installation.rst
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions book/templating.rst
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions components/http_foundation/introduction.rst
Expand Up @@ -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
Expand Down
44 changes: 40 additions & 4 deletions components/process.rst
Expand Up @@ -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.
Expand All @@ -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::
Expand All @@ -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::
Expand Down
2 changes: 2 additions & 0 deletions cookbook/form/create_custom_field_type.rst
Expand Up @@ -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
-------------------------------------

Expand Down

0 comments on commit f2b48c7

Please sign in to comment.