Skip to content

Commit 48c2900

Browse files
authored
Backport UPGRADE-5.0 (#827)
1 parent 96165c9 commit 48c2900

File tree

1 file changed

+51
-4
lines changed

1 file changed

+51
-4
lines changed

UPGRADE-5.0.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
UPGRADE FROM 4.x to 5.0
22
=======================
33

4+
## PHP version and dependencies
5+
6+
* Add support for Symfony 7.0 and require at least Symfony 6.4
7+
* `doctrine/mongodb-odm` 2.6 and `doctrine/persistence` 3.0 are required
8+
9+
## Annotations
10+
11+
* Remove support of Annotation mapping, you should use Attributes or XML instead.
12+
13+
## Commands
14+
15+
* All command and compiler pass classes are internal and final. They cannot be
16+
used directly or extended.
417
* The `doctrine:mongodb:tail-cursor` command and
518
`Doctrine\Bundle\MongoDBBundle\Cursor\TailableCursorProcessorInterface`
619
interface have been dropped. You should use
@@ -9,7 +22,41 @@ UPGRADE FROM 4.x to 5.0
922
`findBundle` and `findBasePathForBundle` methods from
1023
`Doctrine\Bundle\MongoDBBundle\Command\DoctrineODMCommand` have been
1124
removed without replacement.
12-
* The `Doctrine\Bundle\MongoDBBundle\Command\DoctrineODMCommand` class is now
13-
`@internal`, you should not extend from this class.
14-
* `Doctrine\Bundle\MongoDBBundle\EventSubscriber\EventSubscriberInterface` has
15-
been removed. Use the `#[AsDocumentListener]` attribute instead.
25+
26+
## Configuration
27+
28+
Remove all `doctrine_mongodb.odm.*` parameters.
29+
30+
Deprecated options have been removed:
31+
32+
| namespace | removed | replaced by |
33+
|--------------------------|-------------|--------------------|
34+
| `default_commit_options` | `fsync` | `j` |
35+
| `default_commit_options` | `safe` | `w` |
36+
| `connections.*.options` | `fsync` | `journal` |
37+
| `connections.*.options` | `slaveOkay` | `readPreference` |
38+
| `connections.*.options` | `timeout` | `connectTimeoutMS` |
39+
| `connections.*.options` | `wTimeout` | `wTimeoutMS` |
40+
41+
## Event Subscriber
42+
43+
* Remove `Doctrine\Bundle\MongoDBBundle\EventSubscriber\EventSubscriberInterface`.
44+
Use the `#[AsDocumentListener]` attribute instead.
45+
* Remove parameters `$method` and `$lazy` of `#[AsDocumentListener]`, they are
46+
not used.
47+
48+
## Fixtures
49+
50+
* Remove `--service` option from `doctrine:mongodb:fixtures:load` command
51+
* Remove automatic injection of the container in fixtures classes implementing
52+
`ContainerAwareInterface`. You should use dependency injection instead.
53+
* Remove the `fixture_loader` configuration
54+
55+
## Cache
56+
57+
The `Doctrine\Common\Cache\` providers are not supported anymore. The configuration
58+
uses `Symfony\Component\Cache\Adapter\` providers instead, for PSR-6 compatibility.
59+
60+
If you want to use redis or memcached, the configuration of `host`, `port` and `instance_class`
61+
must be done for each document manager. The parameters `doctrine_mongodb.odm.cache.memcached_*`
62+
and `doctrine_mongodb.odm.cache.redis_*` are not read anymore.

0 commit comments

Comments
 (0)