mirror of
https://github.com/doctrine/DoctrineMongoDBBundle.git
synced 2026-03-23 22:32:07 +01:00
2.4 KiB
2.4 KiB
UPGRADE FROM 4.x to 5.0
PHP version and dependencies
- Add support for Symfony 7.0 and require at least Symfony 6.4
doctrine/mongodb-odm2.6 anddoctrine/persistence3.0 are required
Annotations
- Remove support of Annotation mapping, you should use Attributes or XML instead.
Commands
- All command and compiler pass classes are internal and final. They cannot be used directly or extended.
- The
doctrine:mongodb:tail-cursorcommand andDoctrine\Bundle\MongoDBBundle\Cursor\TailableCursorProcessorInterfaceinterface have been dropped. You should use change streams instead. - The
setContainer,getContainer,getDoctrineDocumentManagers,findBundleandfindBasePathForBundlemethods fromDoctrine\Bundle\MongoDBBundle\Command\DoctrineODMCommandhave been removed without replacement.
Configuration
Remove all doctrine_mongodb.odm.* parameters.
Deprecated options have been removed:
| namespace | removed | replaced by |
|---|---|---|
default_commit_options |
fsync |
j |
default_commit_options |
safe |
w |
connections.*.options |
fsync |
journal |
connections.*.options |
slaveOkay |
readPreference |
connections.*.options |
timeout |
connectTimeoutMS |
connections.*.options |
wTimeout |
wTimeoutMS |
Event Subscriber
- Remove
Doctrine\Bundle\MongoDBBundle\EventSubscriber\EventSubscriberInterface. Use the#[AsDocumentListener]attribute instead. - Remove parameters
$methodand$lazyof#[AsDocumentListener], they are not used.
Fixtures
- Remove
--serviceoption fromdoctrine:mongodb:fixtures:loadcommand - Remove automatic injection of the container in fixtures classes implementing
ContainerAwareInterface. You should use dependency injection instead. - Remove the
fixture_loaderconfiguration
Cache
The Doctrine\Common\Cache\ providers are not supported anymore. The configuration
uses Symfony\Component\Cache\Adapter\ providers instead, for PSR-6 compatibility.
If you want to use redis or memcached, the configuration of host, port and instance_class
must be done for each document manager. The parameters doctrine_mongodb.odm.cache.memcached_*
and doctrine_mongodb.odm.cache.redis_* are not read anymore.