-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Cache] Add new cache.adapter.doctrine_dbal #16502
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
base: 5.4
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -105,6 +105,7 @@ The Cache component comes with a series of adapters pre-configured: | |||||
* :doc:`cache.adapter.apcu </components/cache/adapters/apcu_adapter>` | ||||||
* :doc:`cache.adapter.array </components/cache/adapters/array_cache_adapter>` | ||||||
* :doc:`cache.adapter.doctrine </components/cache/adapters/doctrine_adapter>` | ||||||
* :doc:`cache.adapter.doctrine_dbal </components/cache/adapters/pdo_doctrine_dbal_adapter>` | ||||||
* :doc:`cache.adapter.filesystem </components/cache/adapters/filesystem_adapter>` | ||||||
* :doc:`cache.adapter.memcached </components/cache/adapters/memcached_adapter>` | ||||||
* :doc:`cache.adapter.pdo </components/cache/adapters/pdo_doctrine_dbal_adapter>` | ||||||
|
@@ -116,6 +117,10 @@ The Cache component comes with a series of adapters pre-configured: | |||||
|
||||||
``cache.adapter.redis_tag_aware`` has been introduced in Symfony 5.2. | ||||||
|
||||||
.. versionadded:: 5.4 | ||||||
|
||||||
``cache.adapter.doctrine_dbal`` has been introduced in Symfony 5.4. | ||||||
|
||||||
Some of these adapters could be configured via shortcuts. Using these shortcuts | ||||||
will create pools with service IDs that follow the pattern ``cache.[type]``. | ||||||
|
||||||
|
@@ -138,6 +143,8 @@ will create pools with service IDs that follow the pattern ``cache.[type]``. | |||||
default_memcached_provider: 'memcached://localhost' | ||||||
# service: cache.pdo | ||||||
default_pdo_provider: 'doctrine.dbal.default_connection' | ||||||
# service: cache.doctrine_dbal | ||||||
default_doctrine_dbal_provider: 'doctrine.dbal.default_connection' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this here too, as the service However, i'm not sure to understand properly this part of the doc. As far as i understand, a new pool should be created, named There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/symfony/framework-bundle/blob/5.4/DependencyInjection/Configuration.php#L1081
Suggested change
|
||||||
|
||||||
.. code-block:: xml | ||||||
|
||||||
|
@@ -158,6 +165,7 @@ will create pools with service IDs that follow the pattern ``cache.[type]``. | |||||
default_redis_provider: Service: cache.redis | ||||||
default_memcached_provider: Service: cache.memcached | ||||||
default_pdo_provider: Service: cache.pdo | ||||||
default_doctrine_dbal_provider: Service: cache.doctrine_dbal | ||||||
--> | ||||||
<!-- "directory" attribute is only used with cache.adapter.filesystem --> | ||||||
<framework:cache directory="%kernel.cache_dir%/pools" | ||||||
|
@@ -166,6 +174,7 @@ will create pools with service IDs that follow the pattern ``cache.[type]``. | |||||
default_redis_provider="redis://localhost" | ||||||
default_memcached_provider="memcached://localhost" | ||||||
default_pdo_provider="doctrine.dbal.default_connection" | ||||||
default_doctrine_dbal_provider="doctrine.dbal.default_connection" | ||||||
/> | ||||||
</framework:config> | ||||||
</container> | ||||||
|
@@ -189,6 +198,8 @@ will create pools with service IDs that follow the pattern ``cache.[type]``. | |||||
->defaultMemcachedProvider('memcached://localhost') | ||||||
// Service: cache.pdo | ||||||
->defaultPdoProvider('doctrine.dbal.default_connection') | ||||||
// Service: cache.doctrine_dbal | ||||||
->defaultDoctrineDbalProvider('doctrine.dbal.default_connection') | ||||||
; | ||||||
}; | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PDO adapter no longer accept DBAL Connection. This line needs an update too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends on the availability of "doctrine/dbal": https://github.com/symfony/framework-bundle/blob/5.4/DependencyInjection/Configuration.php#L1082
If available:
database_connection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the default config missing an update? DBAL doesn't extend PDO anymore, isn't it? So we can't set a default value here (unless we can access the PDO object when we have a DBAL connection?)
Would anyone like to dig this question?