Remove support for PHPDriver #6890

Open
opened 2026-01-22 15:40:47 +01:00 by admin · 0 comments
Owner

Originally created by @beberlei on GitHub (Dec 20, 2021).

Q A
New Feature yes
RFC no
BC Break yes/

Summary

We should deprecate and remove the PHPDriver, because using a magic variable $metadata in a file is confusing and the StaticPHPDriver offers a better API with a method on the entity. This will reduce the amount of test-code we have to maintain significantly.

Users can use the orm:convert-mapping command in the 2.* branches to move to another mapping driver without great effort.

In addition if they want to stay with programmatic metadata configuration, StaticPHPDriver could be used in a simple way to keep the old mapping:

class City
{
    public static function loadMetadata(ClassMetadata $metadata)
    {
        include "path/to/mapping/City.php";
    }
}
Originally created by @beberlei on GitHub (Dec 20, 2021). | Q | A |------------ | ------ | New Feature | yes | RFC | no | BC Break | yes/ ## Summary We should deprecate and remove the PHPDriver, because using a magic variable `$metadata` in a file is confusing and the StaticPHPDriver offers a better API with a method on the entity. This will reduce the amount of test-code we have to maintain significantly. Users can use the `orm:convert-mapping` command in the 2.* branches to move to another mapping driver without great effort. In addition if they want to stay with programmatic metadata configuration, `StaticPHPDriver` could be used in a simple way to keep the old mapping: ```php class City { public static function loadMetadata(ClassMetadata $metadata) { include "path/to/mapping/City.php"; } } ```
admin added the ImprovementDeprecation labels 2026-01-22 15:40:47 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6890