Skip to content

Commit c4ebee2

Browse files
committed
Merge branch '2.8' into 3.0
Conflicts: cookbook/profiler/profiling_data.rst
2 parents 0fb7847 + 9916abf commit c4ebee2

File tree

11 files changed

+84
-37
lines changed

11 files changed

+84
-37
lines changed

components/console/introduction.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Coloring the Output
143143
By default, the Windows command console doesn't support output coloring. The
144144
Console component disables output coloring for Windows systems, but if your
145145
commands invoke other scripts which emit color sequences, they will be
146-
wrongly displayed as raw escape characters. Install the `ConEmu`_, `ANSICON`_
146+
wrongly displayed as raw escape characters. Install the `Cmder`_, `ConEmu`_, `ANSICON`_
147147
or `Mintty`_ (used by default in GitBash and Cygwin) free applications
148148
to add coloring support to your Windows command console.
149149

@@ -577,6 +577,7 @@ Learn More!
577577
* :doc:`/components/console/console_arguments`
578578

579579
.. _Packagist: https://packagist.org/packages/symfony/console
580+
.. _Cmder: http://cmder.net/
580581
.. _ConEmu: https://conemu.github.io/
581582
.. _ANSICON: https://github.com/adoxa/ansicon/releases
582583
.. _Mintty: https://mintty.github.io/

components/dependency_injection/autowiring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ returning the result of the ROT13 transformation uppercased::
250250
}
251251
}
252252

253-
This class is intended to decorate the any transformer and return its value uppercased.
253+
This class is intended to decorate any transformer and return its value uppercased.
254254

255255
We can now refactor the controller to add another endpoint leveraging this new
256256
transformer::

components/dependency_injection/lazy_services.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ your lazy loaded services are working.
9797

9898
.. note::
9999

100-
If you don't install the `ProxyManager bridge`_, the container will
101-
just skip over the ``lazy`` flag and simply instantiate the service
102-
as it would normally do.
100+
If you don't install the `ProxyManager bridge`_ and the
101+
`ocramius/proxy-manager`_, the container will just skip over the ``lazy``
102+
flag and simply instantiate the service as it would normally do.
103103

104104
The proxy gets initialized and the actual service is instantiated as soon
105105
as you interact in any way with this object.
@@ -114,3 +114,4 @@ in the `documentation of ProxyManager`_.
114114
.. _`ProxyManager bridge`: https://github.com/symfony/symfony/tree/master/src/Symfony/Bridge/ProxyManager
115115
.. _`proxy`: https://en.wikipedia.org/wiki/Proxy_pattern
116116
.. _`documentation of ProxyManager`: https://github.com/Ocramius/ProxyManager/blob/master/docs/lazy-loading-value-holder.md
117+
.. _`ocramius/proxy-manager`: https://github.com/Ocramius/ProxyManager

contributing/code/tests.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ what's going on and if the tests are broken because of the new code.
5151
5252
.. tip::
5353

54-
On Windows, install the `ConEmu`_, `ANSICON`_ or `Mintty`_ free applications
54+
On Windows, install the `Cmder`_, `ConEmu`_, `ANSICON`_ or `Mintty`_ free applications
5555
to see colored test results.
5656

57+
.. _Cmder: http://cmder.net/
5758
.. _ConEmu: https://code.google.com/p/conemu-maximus5/
5859
.. _ANSICON: https://github.com/adoxa/ansicon/releases
5960
.. _Mintty: https://mintty.github.io/

cookbook/bundles/extension.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,39 @@ Using Configuration to Change the Services
125125
The Extension is also the class that handles the configuration for that
126126
particular bundle (e.g. the configuration in ``app/config/config.yml``). To
127127
read more about it, see the ":doc:`/cookbook/bundles/configuration`" article.
128+
129+
Adding Classes to Compile
130+
-------------------------
131+
132+
Symfony creates a big ``classes.php`` file in the cache directory to aggregate
133+
the contents of the PHP classes that are used in every request. This reduces the
134+
I/O operations and increases the application performance.
135+
136+
Your bundles can also add their own classes into this file thanks to the
137+
``addClassesToCompile()`` method. Define the classes to compile as an array of
138+
their fully qualified class names::
139+
140+
// ...
141+
public function load(array $configs, ContainerBuilder $container)
142+
{
143+
// ...
144+
145+
$this->addClassesToCompile(array(
146+
'AppBundle\\Manager\\UserManager',
147+
'AppBundle\\Utils\\Slugger',
148+
// ...
149+
));
150+
}
151+
152+
.. note::
153+
154+
If some class extends from other classes, all its parents are automatically
155+
included in the list of classes to compile.
156+
157+
Beware that this technique **can't be used in some cases**:
158+
159+
* When classes contain annotations, such as controllers with ``@Route``
160+
annotations and entities with ``@ORM`` or ``@Assert`` annotations, because
161+
the file location retrieved from PHP reflection changes;
162+
* When classes use the ``__DIR__`` and ``__FILE__`` constants, because their
163+
values will change when loading these classes from the ``classes.php`` file.

cookbook/console/logging.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ First configure a listener for console exception events in the service container
8181
8282
# app/config/services.yml
8383
services:
84-
kernel.listener.command_dispatch:
84+
app.listener.command_exception:
8585
class: AppBundle\EventListener\ConsoleExceptionListener
8686
arguments: ['@logger']
8787
tags:
@@ -96,7 +96,7 @@ First configure a listener for console exception events in the service container
9696
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
9797
9898
<services>
99-
<service id="kernel.listener.command_dispatch" class="AppBundle\EventListener\ConsoleExceptionListener">
99+
<service id="app.listener.command_exception" class="AppBundle\EventListener\ConsoleExceptionListener">
100100
<argument type="service" id="logger"/>
101101
<tag name="kernel.event_listener" event="console.exception" />
102102
</service>
@@ -118,7 +118,7 @@ First configure a listener for console exception events in the service container
118118
array('event' => 'console.exception')
119119
);
120120
$container->setDefinition(
121-
'kernel.listener.command_dispatch',
121+
'app.listener.command_exception',
122122
$definitionConsoleExceptionListener
123123
);
124124
@@ -178,7 +178,7 @@ First configure a listener for console terminate events in the service container
178178
179179
# app/config/services.yml
180180
services:
181-
kernel.listener.command_dispatch:
181+
app.listener.command_error:
182182
class: AppBundle\EventListener\ErrorLoggerListener
183183
arguments: ['@logger']
184184
tags:
@@ -193,7 +193,7 @@ First configure a listener for console terminate events in the service container
193193
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
194194
195195
<services>
196-
<service id="kernel.listener.command_dispatch" class="AppBundle\EventListener\ErrorLoggerListener">
196+
<service id="app.listener.command_error" class="AppBundle\EventListener\ErrorLoggerListener">
197197
<argument type="service" id="logger"/>
198198
<tag name="kernel.event_listener" event="console.terminate" />
199199
</service>
@@ -215,7 +215,7 @@ First configure a listener for console terminate events in the service container
215215
array('event' => 'console.terminate')
216216
);
217217
$container->setDefinition(
218-
'kernel.listener.command_dispatch',
218+
'app.listener.command_error',
219219
$definitionErrorLoggerListener
220220
);
221221

cookbook/console/style.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ Result Methods
300300

301301
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::warning`
302302
It displays the given string or array of strings highlighted as a warning
303-
message (with a read background and the ``[WARNING]`` label). It's meant to be
303+
message (with a red background and the ``[WARNING]`` label). It's meant to be
304304
used once to display the final result of executing the given command, but you
305305
can use it repeatedly during the execution of the command::
306306

@@ -317,7 +317,7 @@ Result Methods
317317

318318
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::error`
319319
It displays the given string or array of strings highlighted as an error
320-
message (with a read background and the ``[ERROR]`` label). It's meant to be
320+
message (with a red background and the ``[ERROR]`` label). It's meant to be
321321
used once to display the final result of executing the given command, but you
322322
can use it repeatedly during the execution of the command::
323323

cookbook/frontend/bower.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ it's installed correctly.
2525
.. tip::
2626

2727
If you don't want to have NodeJS on your computer, you can also use
28-
BowerPHP_ (an unofficial PHP port of Bower). Beware that this is still in
29-
an alpha state. If you're using BowerPHP, use ``bowerphp`` instead of
28+
BowerPHP_ (an unofficial PHP port of Bower). Beware that this is currently
29+
in beta status. If you're using BowerPHP, use ``bowerphp`` instead of
3030
``bower`` in the examples.
3131

3232
Configuring Bower in your Project

cookbook/profiler/profiling_data.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ The ``profiler`` service also provides the
3434
look for tokens based on some criteria::
3535

3636
// get the latest 10 tokens
37-
$tokens = $container->get('profiler')->find('', '', 10, '', '');
37+
$tokens = $container->get('profiler')->find('', '', 10, '', '', '');
3838

3939
// get the latest 10 tokens for all URL containing /admin/
40-
$tokens = $container->get('profiler')->find('', '/admin/', 10, '', '');
40+
$tokens = $container->get('profiler')->find('', '/admin/', 10, '', '', '');
4141

42-
// get the latest 10 tokens for local requests
43-
$tokens = $container->get('profiler')->find('127.0.0.1', '', 10, '', '');
42+
// get the latest 10 tokens for local POST requests
43+
$tokens = $container->get('profiler')->find('127.0.0.1', '', 10, 'POST', '', '');
4444

4545
// get the latest 10 tokens for requests that happened between 2 and 4 days ago
4646
$tokens = $container->get('profiler')
47-
->find('', '', 10, '4 days ago', '2 days ago');
47+
->find('', '', 10, '', '4 days ago', '2 days ago');

cookbook/testing/doctrine.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@ which makes all of this quite easy::
6262
parent::tearDown();
6363

6464
$this->em->close();
65+
$this->em = null; // avoid memory leaks
6566
}
6667
}

0 commit comments

Comments
 (0)