Skip to content

Commit 118a9ae

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

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

components/cache/adapters/pdo_doctrine_dbal_adapter.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,19 @@ third, and forth parameters::
2727
// until the database table is truncated or its rows are otherwise deleted)
2828
$defaultLifetime = 0,
2929

30-
// an array of options for configuring the database connection
30+
// an array of options for configuring the database table and connection
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

components/cache/cache_invalidation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The Symfony Cache component provides two mechanisms to help solving this problem
2020
Using Cache Tags
2121
----------------
2222

23-
To benefit from tags based invalidation, you need to attach the proper tags to
23+
To benefit from tags-based invalidation, you need to attach the proper tags to
2424
each cached item. Each tag is a plain string identifier that you can use at any
2525
time to trigger the removal of all items associated with this tag.
2626

components/cache/cache_pools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ allowing manual removal of stale cache items::
184184

185185
The :ref:`ChainAdapter <component-cache-chain-adapter>` implementation does not directly
186186
contain any pruning logic itself. Instead, when calling the chain adapter's
187-
:method:`Symfony\\Component\\Cache\\ChainAdapter::prune` method, the call is delegated to all
187+
:method:`Symfony\\Component\\Cache\\Adapter\\ChainAdapter::prune` method, the call is delegated to all
188188
its compatible cache adapters (and those that do not implement ``PruneableInterface`` are
189189
silently ignored)::
190190

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)