Skip to content

Commit bcc1cc4

Browse files
committed
minor #6090 Reworded the article about profiler storage (xavierleune, javiereguiluz)
This PR was merged into the 3.0 branch. Discussion ---------- Reworded the article about profiler storage | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 3.0+ | Fixed tickets | - This finishes #6024. Commits ------- bcbb87f Fixed the Symfony version number bcc5634 Finished the rewording of the "profiler storage" article 32a63d8 ProfilerStorage configuration
2 parents 2c9b1ec + bcbb87f commit bcc1cc4

File tree

1 file changed

+14
-59
lines changed

1 file changed

+14
-59
lines changed

cookbook/profiler/storage.rst

Lines changed: 14 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,66 +4,21 @@
44
Switching the Profiler Storage
55
==============================
66

7-
By default the profile stores the collected data in files in the ``%kernel.cache_dir%/profiler/`` directory.
8-
You can control the storage being used through the ``dsn``, ``username``,
9-
``password`` and ``lifetime`` options. For example, the following configuration
10-
uses MySQL as the storage for the profiler with a lifetime of one hour:
7+
In Symfony versions previous to 3.0, profiles could be stored in files, databases,
8+
services like Redis and Memcache, etc. Starting from Symfony 3.0, the only storage
9+
mechanism with built-in support is the filesystem.
1110

12-
.. configuration-block::
11+
By default the profile stores the collected data in the ``%kernel.cache_dir%/profiler/``
12+
directory. If you want to use another location to store the profiles, define the
13+
``dsn`` option of the ``framework.profiler``:
1314

14-
.. code-block:: yaml
15+
.. code-block:: yaml
1516
16-
# app/config/config.yml
17-
framework:
18-
profiler:
19-
dsn: 'mysql:host=localhost;dbname=%database_name%'
20-
username: '%database_user%'
21-
password: '%database_password%'
22-
lifetime: 3600
17+
# app/config/config.yml
18+
framework:
19+
profiler:
20+
dsn: 'file:/tmp/symfony/profiler'
2321
24-
.. code-block:: xml
25-
26-
<!-- app/config/config.xml -->
27-
<?xml version="1.0" encoding="UTF-8" ?>
28-
<container xmlns="http://symfony.com/schema/dic/services"
29-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30-
xmlns:framework="http://symfony.com/schema/dic/symfony"
31-
xsi:schemaLocation="http://symfony.com/schema/dic/services
32-
http://symfony.com/schema/dic/services/services-1.0.xsd
33-
http://symfony.com/schema/dic/symfony
34-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
35-
>
36-
<framework:config>
37-
<framework:profiler
38-
dsn="mysql:host=localhost;dbname=%database_name%"
39-
username="%database_user%"
40-
password="%database_password%"
41-
lifetime="3600"
42-
/>
43-
</framework:config>
44-
</container>
45-
46-
.. code-block:: php
47-
48-
// app/config/config.php
49-
50-
// ...
51-
$container->loadFromExtension('framework', array(
52-
'profiler' => array(
53-
'dsn' => 'mysql:host=localhost;dbname=%database_name%',
54-
'username' => '%database_user',
55-
'password' => '%database_password%',
56-
'lifetime' => 3600,
57-
),
58-
));
59-
60-
The :doc:`HttpKernel component </components/http_kernel/introduction>` currently
61-
supports the following profiler storage drivers:
62-
63-
* file
64-
* sqlite
65-
* mysql
66-
* mongodb
67-
* memcache
68-
* memcached
69-
* redis
22+
You can also create your own profile storage service implementing the
23+
:class:``Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface`` and
24+
overriding the ``profiler.storage`` service.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy