Skip to content

Commit 2b9675a

Browse files
committed
Merge branch '2.5'
* 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
2 parents e5d432c + 77d166b commit 2b9675a

File tree

6 files changed

+71
-7
lines changed

6 files changed

+71
-7
lines changed

book/service_container.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ configuration.
377377
// app/config/config.php
378378
$loader->import('@AcmeHelloBundle/Resources/config/services.php');
379379
380+
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
381+
380382
The ``imports`` directive allows your application to include service container
381383
configuration resources from any other location (most commonly from bundles).
382384
The ``resource`` location, for files, is the absolute path to the resource
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. note::
2+
3+
Due to the way in which parameters are resolved, you cannot use them to
4+
build paths in imports dynamically. This means that something like the
5+
following doesn't work:
6+
7+
.. configuration-block::
8+
9+
.. code-block:: yaml
10+
11+
# app/config/config.yml
12+
imports:
13+
- { resource: "%kernel.root_dir%/parameters.yml" }
14+
15+
.. code-block:: xml
16+
17+
<!-- app/config/config.xml -->
18+
<?xml version="1.0" encoding="UTF-8" ?>
19+
<container xmlns="http://symfony.com/schema/dic/services"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
22+
23+
<imports>
24+
<import resource="%kernel.root_dir%/parameters.yml" />
25+
</imports>
26+
</container>
27+
28+
.. code-block:: php
29+
30+
// app/config/config.php
31+
$loader->import('%kernel.root_dir%/parameters.yml');

components/process.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ a command in a sub-process::
3131
throw new \RuntimeException($process->getErrorOutput());
3232
}
3333

34-
print $process->getOutput();
34+
echo $process->getOutput();
3535

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

53+
.. versionadded:: 2.5
54+
The ``mustRun()`` method was introduced in Symfony 2.5.
55+
56+
The ``mustRun()`` method is identical to ``run()``, except that it will throw
57+
a :class:`Symfony\\Component\\Process\\Exception\\ProcessFailedException`
58+
if the process couldn't be executed successfully (i.e. the process exited
59+
with a non-zero code)::
60+
61+
use Symfony\Component\Process\Exception\ProcessFailedException;
62+
use Symfony\Component\Process\Process;
63+
64+
$process = new Process('ls -lsa');
65+
66+
try {
67+
$process->mustRun();
68+
69+
echo $process->getOutput();
70+
} catch (ProcessFailedException $e) {
71+
echo $e->getMessage();
72+
}
73+
5374
Getting real-time Process Output
5475
--------------------------------
5576

@@ -218,17 +239,17 @@ Process Idle Timeout
218239
.. versionadded:: 2.4
219240
The :method:`Symfony\\Component\\Process\\Process::setIdleTimeout` method
220241
was introduced in Symfony 2.4.
221-
242+
222243
In contrast to the timeout of the previous paragraph, the idle timeout only
223244
considers the time since the last output was produced by the process::
224245

225246
use Symfony\Component\Process\Process;
226-
247+
227248
$process = new Process('something-with-variable-runtime');
228249
$process->setTimeout(3600);
229250
$process->setIdleTimeout(60);
230251
$process->run();
231-
252+
232253
In the case above, a process is considered timed out, when either the total runtime
233254
exceeds 3600 seconds, or the process does not produce any output for 60 seconds.
234255

cookbook/assetic/yuicompressor.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ you can take advantage of this tool very easily.
1010

1111
.. caution::
1212

13-
The YUI Compressor is going through a `deprecation process`_. But don't
14-
worry! See :doc:`/cookbook/assetic/uglifyjs` for an alternative.
13+
The YUI Compressor is `no longer maintained by Yahoo`_ but by an independent
14+
volunteer. Moreover, Yahoo has decided to `stop all new development on YUI`_
15+
and to move to other modern alternatives such as Node.js.
16+
17+
That's why you are **strongly advised** to avoid using YUI utilities unless
18+
strictly necessary. Read :doc:`/cookbook/assetic/uglifyjs` for a modern and
19+
up-to-date alternative.
1520

1621
Download the YUI Compressor JAR
1722
-------------------------------
@@ -164,4 +169,5 @@ apply this filter when debug mode is off.
164169

165170
.. _`YUI Compressor`: http://developer.yahoo.com/yui/compressor/
166171
.. _`Download the JAR`: https://github.com/yui/yuicompressor/releases
167-
.. _`deprecation process`: http://www.yuiblog.com/blog/2012/10/16/state-of-yui-compressor/
172+
.. _`no longer maintained by Yahoo`: http://www.yuiblog.com/blog/2013/01/24/yui-compressor-has-a-new-owner/
173+
.. _`stop all new development on YUI`: http://yahooeng.tumblr.com/post/96098168666/important-announcement-regarding-yui

cookbook/configuration/configuration_organization.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ needed for the ``app/config/dev/config.yml`` file:
148148
149149
// ...
150150
151+
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
152+
151153
Semantic Configuration Files
152154
----------------------------
153155

cookbook/configuration/environments.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ The best way to accomplish this is via a new environment called, for example,
262262
'profiler' => array('only-exceptions' => false),
263263
));
264264
265+
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
266+
265267
And with this simple addition, the application now supports a new environment
266268
called ``benchmark``.
267269

0 commit comments

Comments
 (0)