From a4046bc9862f136bd136103cc1e2580af2139acf Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 9 Sep 2021 18:04:36 +0200 Subject: [PATCH] Document the removal of Doctrine Cache --- cache.rst | 2 +- components/cache.rst | 7 ++-- .../cache/adapters/doctrine_adapter.rst | 42 ------------------- 3 files changed, 4 insertions(+), 47 deletions(-) delete mode 100644 components/cache/adapters/doctrine_adapter.rst diff --git a/cache.rst b/cache.rst index 0aebff384bc..0538e45f5cd 100644 --- a/cache.rst +++ b/cache.rst @@ -27,7 +27,7 @@ The following example shows a typical usage of the cache:: // ... and to remove the cache key $pool->delete('my_cache_key'); -Symfony supports Cache Contracts, PSR-6/16 and Doctrine Cache interfaces. +Symfony supports Cache Contracts and PSR-6/16 interfaces. You can read more about these at the :doc:`component documentation `. .. deprecated:: 5.4 diff --git a/components/cache.rst b/components/cache.rst index 29c1f0fd42b..1dae4a3f320 100644 --- a/components/cache.rst +++ b/components/cache.rst @@ -16,9 +16,8 @@ The Cache Component .. tip:: - The component also contains adapters to convert between PSR-6, PSR-16 and - Doctrine caches. See :doc:`/components/cache/psr6_psr16_adapters` and - :doc:`/components/cache/adapters/doctrine_adapter`. + The component also contains adapters to convert between PSR-6 and PSR-16. + See :doc:`/components/cache/psr6_psr16_adapters`. .. deprecated:: 5.4 @@ -164,7 +163,7 @@ concepts: **Adapter** It implements the actual caching mechanism to store the information in the filesystem, in a database, etc. The component provides several ready to use - adapters for common caching backends (Redis, APCu, Doctrine, PDO, etc.) + adapters for common caching backends (Redis, APCu, PDO, etc.) Basic Usage (PSR-6) ------------------- diff --git a/components/cache/adapters/doctrine_adapter.rst b/components/cache/adapters/doctrine_adapter.rst deleted file mode 100644 index 81826446f81..00000000000 --- a/components/cache/adapters/doctrine_adapter.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. index:: - single: Cache Pool - single: Doctrine Cache - -.. _doctrine-adapter: - -Doctrine Cache Adapter -====================== - -.. deprecated:: 5.4 - - The ``DoctrineAdapter`` and ``DoctrineProvider`` classes were deprecated in Symfony 5.4 - and it will be removed in Symfony 6.0. - -This adapter wraps any class extending the `Doctrine Cache`_ abstract provider, allowing -you to use these providers in your application as if they were Symfony Cache adapters. - -This adapter expects a ``\Doctrine\Common\Cache\CacheProvider`` instance as its first -parameter, and optionally a namespace and default cache lifetime as its second and -third parameters:: - - use Doctrine\Common\Cache\CacheProvider; - use Doctrine\Common\Cache\SQLite3Cache; - use Symfony\Component\Cache\Adapter\DoctrineAdapter; - - $provider = new SQLite3Cache(new \SQLite3(__DIR__.'/cache/data.sqlite'), 'youTableName'); - - $cache = new DoctrineAdapter( - - // a cache provider instance - CacheProvider $provider, - - // a string prefixed to the keys of the items stored in this cache - $namespace = '', - - // the default lifetime (in seconds) for cache items that do not define their - // own lifetime, with a value 0 causing items to be stored indefinitely (i.e. - // until the database table is truncated or its rows are otherwise deleted) - $defaultLifetime = 0 - ); - -.. _`Doctrine Cache`: https://github.com/doctrine/cache