mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Use ProxyManager #6641
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 (Feb 28, 2021).
We can replace our own proxy generator with https://github.com/FriendsOfPHP/proxy-manager-lts in two steps:
getClassMetadata(get_class($proxy)), which needs a resolver or something alike.@smilesrg commented on GitHub (May 2, 2021):
composer require friendsofphp/proxy-manager-ltscomposer require -W friendsofphp/proxy-manager-ltsLeads to an error:
/cc @beberlei @greg0ire
@greg0ire commented on GitHub (May 2, 2021):
It works for me on
b2f404b25. Have you runcomposer updatebeforehand?@smilesrg commented on GitHub (May 2, 2021):
composer updatehelped, thank you very much!@beberlei commented on GitHub (May 14, 2021):
@alcaeus brought to my attention that our old prototype branch has done this also: https://github.com/doctrine/orm/blob/old-prototype-3.x/lib/Doctrine/ORM/Proxy/Factory/StaticProxyFactory.php - This could be used as a starting point, sorry I didn't see this before.
@alcaeus commented on GitHub (May 14, 2021):
We've had issues around that in ODM. We worked around it, but the upcoming release of doctrine/persistence includes configurable resolvers: https://github.com/doctrine/persistence/pull/145. This will allow a better implementation in ORM without hooking into a number of method calls to resolve proxy class names.
@alcaeus commented on GitHub (May 14, 2021):
@smilesrg please feel free to contact me in either Symfony or Doctrine Slack if you have question. I took @Ocramius' original implementation when adding this feature to MongoDB ODM and learned a number of things that didn't work along the way. I'd be happy to help you get this done.
@smilesrg commented on GitHub (Oct 16, 2021):
@beberlei @alcaeus I tried to get back to this issue, but I'm not sure what should I do and where to start. Probably I need to replace the proxy factory in the EntityManager? Also, change all places that are using EntityManagerInterface::getProxyFactory()? What should be used instead of AbstractProxyFactory methods?
@beberlei commented on GitHub (May 12, 2022):
We should detach this from a milestone for now, effectively unscheduling it, since the
ProxyGeneratoris under our control and the last 2 years have shown that proxy-manager cannot keep up with new features in PHP releases quickly enough for us.@smilesrg commented on GitHub (May 12, 2022):
Why not make a fork? :-)
@Ocramius commented on GitHub (May 12, 2022):
Why not help out instead? I'm not paid to work on it, y'know? 😛
On Thu, 12 May 2022, 12:30 Serhii Smirnov, @.***> wrote:
@smilesrg commented on GitHub (May 12, 2022):
I'd help, but I think some roadmap is needed because I don't know what exactly Doctrine project needs
@Ocramius commented on GitHub (May 12, 2022):
See https://github.com/Ocramius/ProxyManager/milestone/56
Effectively it's just about supporting newer PHP versions, and PHP 8.1 has been a nightmare to upgrade to, with some of the libraries I co-maintain taking multiple months of work just to get there.
In practice, PHP 8.1 is probably the worst release I've dealt with yet :P
@naderman commented on GitHub (Oct 2, 2023):
So PARTIAL has been marked deprecated for a while. In how far can we rely on PARTIAL staying around until lazy loading for 1:1 relationships is implemented as suggested here?
@beberlei commented on GitHub (Oct 6, 2025):
Not needed anymore as we moved towards using native lazy objects in PHP 8.4 - this also undeprecated partial objects as we can use them again with partial lazy object loading in the future.