8000 [Cache] tell about PDO configuration and table autocreation · symfony/symfony-docs@187300a · GitHub
[go: up one dir, main page]

Skip to content

Commit 187300a

Browse files
[Cache] tell about PDO configuration and table autocreation
1 parent 96d3023 commit 187300a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

components/cache/adapters/pdo_doctrine_dbal_adapter.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ third, and forth parameters::
3131
$options = array()
3232
);
3333

34+
.. versionadded:: 4.2
35+
Automatic table creation was introduced in Symfony 4.2.
36+
37+
The table where values are stored is created automatically on the first call to
38+
the :method:`Symfony\\Component\\Cache\\Adapter\\PdoAdapter::save` method.
39+
You can also create this table explicitly by calling the
40+
:method:`Symfony\\Component\\Cache\\Adapter\\PdoAdapter::createTable` method in
41+
your code.
42+
3443
.. tip::
3544

3645
When passed a `Data Source Name (DSN)`_ string (instead of a database connection

reference/configuration/framework.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Configuration
5050
* :ref:`app <reference-cache-app>`
5151
* `default_doctrine_provider`_
5252
* `default_memcached_provider`_
53+
* `default_pdo_provider`_
5354
* `default_psr6_provider`_
5455
* `default_redis_provider`_
5556
* `directory`_
@@ -1834,7 +1835,7 @@ app
18341835
The cache adapter used by the ``cache.app`` service. The FrameworkBundle
18351836
ships with multiple adapters: ``cache.adapter.apcu``, ``cache.adapter.doctrine``,
18361837
``cache.adapter.system``, ``cache.adapter.filesystem``, ``cache.adapter.psr6``,
1837-
``cache.adapter.redis`` and ``cache.adapter.memcached``.
1838+
``cache.adapter.redis``, ``cache.adapter.memcached`` and ``cache.adapter.pdo``.
18381839

18391840
There's also a special adapter called ``cache.adapter.array`` which stores
18401841
contents in memory using a PHP array and it's used to disable caching (mostly on
@@ -1900,6 +1901,14 @@ default_memcached_provider
19001901
The DSN to use by the Memcached provider. The provider is available as the ``cache.memcached``
19011902
service.
19021903

1904+
default_pdo_provider
1905+
..........................
1906+
1907+
**type**: ``string`` **default**: ``doctrine.dbal.default_connection``
1908+
1909+
The service id of the database connection, which should be either a PDO or a
1910+
Doctrine DBAL instance.
1911+
19031912
pools
19041913
.....
19051914

0 commit comments

Comments
 (0)
0