|
4 | 4 | Switching the Profiler Storage
|
5 | 5 | ==============================
|
6 | 6 |
|
7 |
| -In Symfony versions previous to 3.0, profiles could be stored in files, databases, |
| 7 | +In Symfony versions prior to 3.0, profiles could be stored in files, databases, |
8 | 8 | services like Redis and Memcache, etc. Starting from Symfony 3.0, the only storage
|
9 | 9 | mechanism with built-in support is the filesystem.
|
10 | 10 |
|
11 | 11 | By default the profile stores the collected data in the ``%kernel.cache_dir%/profiler/``
|
12 | 12 | directory. If you want to use another location to store the profiles, define the
|
13 | 13 | ``dsn`` option of the ``framework.profiler``:
|
14 | 14 |
|
15 |
| -.. code-block:: yaml |
| 15 | +.. configuration-block:: |
16 | 16 |
|
17 |
| - # app/config/config.yml |
18 |
| - framework: |
19 |
| - profiler: |
20 |
| - dsn: 'file:/tmp/symfony/profiler' |
| 17 | + .. code-block:: yaml |
| 18 | +
|
| 19 | + # app/config/config.yml |
| 20 | + framework: |
| 21 | + profiler: |
| 22 | + dsn: 'file:/tmp/symfony/profiler' |
| 23 | +
|
| 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 dsn="file:/tmp/symfony/profiler" /> |
| 38 | + </framework:config> |
| 39 | + </container> |
| 40 | +
|
| 41 | + .. code-block:: php |
| 42 | +
|
| 43 | + // app/config/config.php |
| 44 | +
|
| 45 | + // ... |
<
6C3D
td data-grid-cell-id="diff-8b393a31ae0b5eb7d189daf0ccaefdfa74bbafe74e65bcd38a168b02804012fb-20-46-0" data-selected="false" role="gridcell" style="background-color:var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num));text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative left-side">
46 | + $container->loadFromExtension('framework', array( |
| 47 | + 'profiler' => array( |
| 48 | + 'dsn' => 'file:/tmp/symfony/profiler', |
| 49 | + ), |
| 50 | + )); |
21 | 51 |
|
22 | 52 | You can also create your own profile storage service implementing the
|
23 | 53 | :class:``Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface`` and
|
|
0 commit comments