From 187300adbaf68ccab07ea67b6a87c394ce3734e2 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 22 Jul 2018 22:54:57 +0200 Subject: [PATCH] [Cache] tell about PDO configuration and table autocreation --- .../cache/adapters/pdo_doctrine_dbal_adapter.rst | 9 +++++++++ reference/configuration/framework.rst | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/components/cache/adapters/pdo_doctrine_dbal_adapter.rst b/components/cache/adapters/pdo_doctrine_dbal_adapter.rst index e80e0738ab2..2dc778b86d6 100644 --- a/components/cache/adapters/pdo_doctrine_dbal_adapter.rst +++ b/components/cache/adapters/pdo_doctrine_dbal_adapter.rst @@ -31,6 +31,15 @@ third, and forth parameters:: $options = array() ); +.. versionadded:: 4.2 + Automatic table creation was introduced in Symfony 4.2. + +The table where values are stored is created automatically on the first call to +the :method:`Symfony\\Component\\Cache\\Adapter\\PdoAdapter::save` method. +You can also create this table explicitly by calling the +:method:`Symfony\\Component\\Cache\\Adapter\\PdoAdapter::createTable` method in +your code. + .. tip:: When passed a `Data Source Name (DSN)`_ string (instead of a database connection diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 5c744b4e9f8..9d6118aabbd 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -50,6 +50,7 @@ Configuration * :ref:`app ` * `default_doctrine_provider`_ * `default_memcached_provider`_ + * `default_pdo_provider`_ * `default_psr6_provider`_ * `default_redis_provider`_ * `directory`_ @@ -1834,7 +1835,7 @@ app The cache adapter used by the ``cache.app`` service. The FrameworkBundle ships with multiple adapters: ``cache.adapter.apcu``, ``cache.adapter.doctrine``, ``cache.adapter.system``, ``cache.adapter.filesystem``, ``cache.adapter.psr6``, -``cache.adapter.redis`` and ``cache.adapter.memcached``. +``cache.adapter.redis``, ``cache.adapter.memcached`` and ``cache.adapter.pdo``. There's also a special adapter called ``cache.adapter.array`` which stores contents in memory using a PHP array and it's used to disable caching (mostly on @@ -1900,6 +1901,14 @@ default_memcached_provider The DSN to use by the Memcached provider. The provider is available as the ``cache.memcached`` service. +default_pdo_provider +.......................... + +**type**: ``string`` **default**: ``doctrine.dbal.default_connection`` + +The service id of the database connection, which should be either a PDO or a +Doctrine DBAL instance. + pools .....