Skip to content

Commit 6c76b2b

Browse files
committed
[#5593] Very little rewording and improving config
1 parent 5772d0f commit 6c76b2b

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

cookbook/profiler/matchers.rst

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ How to Use Matchers to Enable the Profiler Conditionally
66

77
The Symfony profiler is only activated in the development environment to not hurt
88
your application performance. However, sometimes it may be useful to conditionally
9-
enable the profiler in the production environment to assist you in hard to debug
9+
enable the profiler in the production environment to assist you in debugging
1010
issues. This behavior is implemented with the **Request Matchers**.
1111

1212
Using the built-in Matcher
1313
--------------------------
1414

15-
A Request Matcher is a class that checks whether a given ``Request`` instance
15+
A request matcher is a class that checks whether a given ``Request`` instance
1616
matches a set of conditions. Symfony provides a
1717
:class:`built-in matcher <Symfony\\Component\\HttpFoundation\\RequestMatcher>`
1818
which matches paths and IPs. For example, if you want to only show the profiler
@@ -33,16 +33,27 @@ configuration:
3333
.. code-block:: xml
3434
3535
<!-- app/config/config.xml -->
36-
<framework:config>
37-
<framework:profiler
38-
ip="168.0.0.1"
39-
/>
40-
</framework:config>
36+
<?xml version="1.0" encoding="UTF-8" ?>
37+
<container xmlns="http://symfony.com/schema/dic/services"
38+
xmlns:framework="http://symfony.com/schema/dic/symfony"
39+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"
40+
xsi:schemaLocation="http://symfony.com/schema/dic/services
41+
http://symfony.com/schema/dic/services/services-1.0.xsd
42+
http://symfony.com/schema/dic/symfony
43+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
44+
>
45+
46+
<framework:config>
47+
<!-- ... -->
48+
<framework:profiler ip="168.0.0.1" />
49+
</framework:config>
50+
</container>
4151
4252
.. code-block:: php
4353
4454
// app/config/config.php
4555
$container->loadFromExtension('framework', array(
56+
// ...
4657
'profiler' => array(
4758
'ip' => '168.0.0.1',
4859
),
@@ -145,12 +156,21 @@ profiler to use this service as the matcher:
145156
.. code-block:: xml
146157
147158
<!-- app/config/config.xml -->
148-
<framework:config>
149-
<!-- ... -->
150-
<framework:profiler
151-
service="app.super_admin_matcher"
152-
/>
153-
</framework:config>
159+
<?xml version="1.0" encoding="UTF-8" ?>
160+
<container xmlns="http://symfony.com/schema/dic/services"
161+
xmlns:framework="http://symfony.com/schema/dic/symfony"
162+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-Instance"
163+
xsi:schemaLocation="http://symfony.com/schema/dic/services
164+
http://symfony.com/schema/dic/services/services-1.0.xsd
165+
http://symfony.com/schema/dic/symfony
166+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
167+
>
168+
169+
<framework:config>
170+
<!-- ... -->
171+
<framework:profiler service="app.super_admin_matcher" />
172+
</framework:config>
173+
</container>
154174
155175
.. code-block:: php
156176

0 commit comments

Comments
 (0)