Skip to content

[Cache] tell about PDO configuration and table autocreation #10111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/cache/adapters/pdo_doctrine_dbal_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Configuration
* :ref:`app <reference-cache-app>`
* `default_doctrine_provider`_
* `default_memcached_provider`_
* `default_pdo_provider`_
* `default_psr6_provider`_
* `default_redis_provider`_
* `directory`_
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
.....

Expand Down