mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Remove support for PHPDriver #6893
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @beberlei on GitHub (Dec 20, 2021).
Summary
We should deprecate and remove the PHPDriver, because using a magic variable
$metadatain 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-mappingcommand in the 2.* branches to move to another mapping driver without great effort.In addition if they want to stay with programmatic metadata configuration,
StaticPHPDrivercould be used in a simple way to keep the old mapping:@darthf1 commented on GitHub (Jan 4, 2022):
Let me start by saying that I completely understand why wou would want to remove/delete this, when having the
StaticPHPDriveras an alternative.In my codebase, I'm having my domain code and infrastructure code separate. This means that my domain model lives in my
Domainnamespace, and if that model is also a doctrine entity, theres adomain.model.phpin myInfrastructurenamespace somewhere with the magic$metadatavariable.Reading the documentation of the
StaticPHPDriver, theloadMetadatafunction needs to reside inside the entity class, which means it wont be possible to separate these two anymore (with php).Whilst deprecating/removing the
PHPDriver, is it possible to allow the separation of the entity and the mapping for theStaticPHPDriver?@morphles commented on GitHub (Feb 21, 2022):
Just out of curiosity, cause it seems just super counterproductive to me (and even other drivers too), @darthf1 why would you want to separate mapping from entity?
@beberlei commented on GitHub (Feb 21, 2022):
@darthf1 the alternative is to use the XML driver.
@ahundiak commented on GitHub (Mar 31, 2022):
Kind of a shame that the PHPDriver is going away. One thing it allowed was to group the mapping files into one directory while at the same time the entities could live wherever they wanted. You could organize your code by feature. And yes putting your entities in entity specific directories is the norm but it is a bit restrictive.
Looking forward to ORM 3's release. Maybe some clever coder can tweak the xml mapping stuff to support php thus removing the testing burden from the core group.
@morphles commented on GitHub (Mar 31, 2022):
IMO StaticPHP is undoubtedly best driver of them all. Not needlessly separating definitions, allowing to use basic PHP stuff, like constant for discriminator map etc. Not needing to learn/know some new format. All round way better than anything else, just documentation sucks. :(
@derrabus commented on GitHub (May 11, 2022):
Closed via #9309, #9308.