Skip to content

Commit

Permalink
minor #6090 Reworded the article about profiler storage (xavierleune,…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
xabbuh committed Feb 7, 2016
2 parents 2c9b1ec + bcbb87f commit bcc1cc4
Showing 1 changed file with 14 additions and 59 deletions.
73 changes: 14 additions & 59 deletions cookbook/profiler/storage.rst
Expand Up @@ -4,66 +4,21 @@
Switching the Profiler Storage
==============================

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

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

.. code-block:: yaml
.. code-block:: yaml
# app/config/config.yml
framework:
profiler:
dsn: 'mysql:host=localhost;dbname=%database_name%'
username: '%database_user%'
password: '%database_password%'
lifetime: 3600
# app/config/config.yml
framework:
profiler:
dsn: 'file:/tmp/symfony/profiler'
.. 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"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
>
<framework:config>
<framework:profiler
dsn="mysql:host=localhost;dbname=%database_name%"
username="%database_user%"
password="%database_password%"
lifetime="3600"
/>
</framework:config>
</container>
.. code-block:: php
// app/config/config.php
// ...
$container->loadFromExtension('framework', array(
'profiler' => array(
'dsn' => 'mysql:host=localhost;dbname=%database_name%',
'username' => '%database_user',
'password' => '%database_password%',
'lifetime' => 3600,
),
));
The :doc:`HttpKernel component </components/http_kernel/introduction>` currently
supports the following profiler storage drivers:

* file
* sqlite
* mysql
* mongodb
* memcache
* memcached
* redis
You can also create your own profile storage service implementing the
:class:``Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface`` and
overriding the ``profiler.storage`` service.

0 comments on commit bcc1cc4

Please sign in to comment.