Skip to content

Commit

Permalink
Merge branch '2.5'
Browse files Browse the repository at this point in the history
* 2.5:
  [Components][Process] `mustRun()` documentation
  add note about parameters in imports
  Fixed the official name of Node.js
  Added a note about the total deprecation of YUI
  • Loading branch information
weaverryan committed Oct 1, 2014
2 parents e5d432c + 77d166b commit 2b9675a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 7 deletions.
2 changes: 2 additions & 0 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ configuration.
// app/config/config.php
$loader->import('@AcmeHelloBundle/Resources/config/services.php');
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc

The ``imports`` directive allows your application to include service container
configuration resources from any other location (most commonly from bundles).
The ``resource`` location, for files, is the absolute path to the resource
Expand Down
31 changes: 31 additions & 0 deletions components/dependency_injection/_imports-parameters-note.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. note::

Due to the way in which parameters are resolved, you cannot use them to
build paths in imports dynamically. This means that something like the
following doesn't work:

.. configuration-block::

.. code-block:: yaml

# app/config/config.yml
imports:
- { resource: "%kernel.root_dir%/parameters.yml" }

.. code-block:: xml

<!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<imports>
<import resource="%kernel.root_dir%/parameters.yml" />
</imports>
</container>

.. code-block:: php

// app/config/config.php
$loader->import('%kernel.root_dir%/parameters.yml');
29 changes: 25 additions & 4 deletions components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ a command in a sub-process::
throw new \RuntimeException($process->getErrorOutput());
}

print $process->getOutput();
echo $process->getOutput();

The component takes care of the subtle differences between the different platforms
when executing the command.
Expand All @@ -50,6 +50,27 @@ the contents of the output and
:method:`Symfony\\Component\\Process\\Process::clearErrorOutput` clears
the contents of the error output.

.. versionadded:: 2.5
The ``mustRun()`` method was introduced in Symfony 2.5.

The ``mustRun()`` method is identical to ``run()``, except that it will throw
a :class:`Symfony\\Component\\Process\\Exception\\ProcessFailedException`
if the process couldn't be executed successfully (i.e. the process exited
with a non-zero code)::

use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;

$process = new Process('ls -lsa');

try {
$process->mustRun();

echo $process->getOutput();
} catch (ProcessFailedException $e) {
echo $e->getMessage();
}

Getting real-time Process Output
--------------------------------

Expand Down Expand Up @@ -218,17 +239,17 @@ Process Idle Timeout
.. versionadded:: 2.4
The :method:`Symfony\\Component\\Process\\Process::setIdleTimeout` method
was introduced in Symfony 2.4.

In contrast to the timeout of the previous paragraph, the idle timeout only
considers the time since the last output was produced by the process::

use Symfony\Component\Process\Process;

$process = new Process('something-with-variable-runtime');
$process->setTimeout(3600);
$process->setIdleTimeout(60);
$process->run();

In the case above, a process is considered timed out, when either the total runtime
exceeds 3600 seconds, or the process does not produce any output for 60 seconds.

Expand Down
12 changes: 9 additions & 3 deletions cookbook/assetic/yuicompressor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ you can take advantage of this tool very easily.

.. caution::

The YUI Compressor is going through a `deprecation process`_. But don't
worry! See :doc:`/cookbook/assetic/uglifyjs` for an alternative.
The YUI Compressor is `no longer maintained by Yahoo`_ but by an independent
volunteer. Moreover, Yahoo has decided to `stop all new development on YUI`_
and to move to other modern alternatives such as Node.js.

That's why you are **strongly advised** to avoid using YUI utilities unless
strictly necessary. Read :doc:`/cookbook/assetic/uglifyjs` for a modern and
up-to-date alternative.

Download the YUI Compressor JAR
-------------------------------
Expand Down Expand Up @@ -164,4 +169,5 @@ apply this filter when debug mode is off.

.. _`YUI Compressor`: http://developer.yahoo.com/yui/compressor/
.. _`Download the JAR`: https://github.com/yui/yuicompressor/releases
.. _`deprecation process`: http://www.yuiblog.com/blog/2012/10/16/state-of-yui-compressor/
.. _`no longer maintained by Yahoo`: http://www.yuiblog.com/blog/2013/01/24/yui-compressor-has-a-new-owner/
.. _`stop all new development on YUI`: http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui
2 changes: 2 additions & 0 deletions cookbook/configuration/configuration_organization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ needed for the ``app/config/dev/config.yml`` file:
// ...
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc

Semantic Configuration Files
----------------------------

Expand Down
2 changes: 2 additions & 0 deletions cookbook/configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ The best way to accomplish this is via a new environment called, for example,
'profiler' => array('only-exceptions' => false),
));
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc

And with this simple addition, the application now supports a new environment
called ``benchmark``.

Expand Down

0 comments on commit 2b9675a

Please sign in to comment.