diff --git a/cookbook/map.rst.inc b/cookbook/map.rst.inc index 9c8260fd929..5a5c830c49e 100644 --- a/cookbook/map.rst.inc +++ b/cookbook/map.rst.inc @@ -104,6 +104,7 @@ * :doc:`/cookbook/profiler/data_collector` * :doc:`/cookbook/profiler/matchers` + * :doc:`/cookbook/profiler/storage` * :doc:`/cookbook/request/index` diff --git a/cookbook/profiler/index.rst b/cookbook/profiler/index.rst index 3900380f932..7ff3abe1982 100644 --- a/cookbook/profiler/index.rst +++ b/cookbook/profiler/index.rst @@ -6,3 +6,4 @@ Profiler data_collector matchers + storage diff --git a/cookbook/profiler/storage.rst b/cookbook/profiler/storage.rst new file mode 100644 index 00000000000..95f070393cf --- /dev/null +++ b/cookbook/profiler/storage.rst @@ -0,0 +1,69 @@ +.. index:: + single: Profiling; Storage Configuration + +Switching the Profiler Storage +============================== + +By default the profile stores the collected data in a file in the cache 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: + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/config.yml + framework: + profiler: + dsn: "mysql:host=localhost;dbname=%database_name%" + username: "%database_user%" + password: "%database_password%" + lifetime: 3600 + + .. code-block:: xml + + + + + + + + + + .. 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 ` currently +supports the following profiler storage implementations: + +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\FileProfilerStorage` +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\MemcachedProfilerStorage` +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\MemcacheProfilerStorage` +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\MongoDbProfilerStorage` +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\MysqlProfilerStorage` +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\RedisProfilerStorage` +* :class:`Symfony\\Component\\HttpKernel\\Profiler\\SqliteProfilerStorage`