Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace proxy layer with ProxyManager's layer #6719

Merged
merged 90 commits into from
Sep 24, 2017

Conversation

Ocramius
Copy link
Member

@Ocramius Ocramius commented Sep 22, 2017

Replaces #1241

TODOs:

  • replace proxy instantiation with ProxyManager proxies
  • ensure that ProxyManager class names are properly recognized
  • remove ClassUtils shim
  • ~~~move proxy instantiation and definition to the metadata~~~
  • remove Proxy* related code in ORM
  • update Doctrine\ORM\Configuration to work with ProxyManager utilities
  • update ClassUtils to work with ProxyManager proxy class names
  • remove public properties hack
  • extract identifier normalization to its own object that is the opposite of IdentifierFlattener
  • test "friend object" behavior with proxies (shared private scope access)
  • test that EntityManager#getReference() calls ProxyFactory#getProxy() with un-touched data
  • document BC break extent:
    • __sleep behavior changes
    • __wakeup behavior changes
    • serialize() no longer breaks the graph -> potentially dangerous if serializing over large association graphs
    • Proxy interface gone
    • private property access now triggers lazy-loading
    • ReflectionProperty property access now triggers lazy-loading
  • document improvements
    • "friend object" behavior with proxies (shared private scope access)
    • private property access now triggers lazy-loading
    • ReflectionProperty property access now triggers lazy-loading
    • proxies no longer lazy-load when no internal state is accessed
    • no more "identifier getter" hacks
    • no more type conversion hacks
    • identifier fields are always set, and always have the expected type
  • benchmark regression testing

…parser should not manually do `class_exists` checks unless strictly required
…have notify property listeners to function correctly
…eplaced with `GhostObjectInterface` checks
… a proxy should NOT modify its state, but just make it non-managed
…ching associated identifiers (which are already available)
…t while cloning, but they are not considered managed
…o overwrite the entity data, in which case the `UnitOfWork` is indeed tracking entity state
@Ocramius Ocramius assigned Ocramius and unassigned Majkl578 Sep 24, 2017
@Ocramius
Copy link
Member Author

🚢

@Ocramius Ocramius merged commit 67d800a into doctrine:develop Sep 24, 2017
@Ocramius Ocramius deleted the cleanup/replace-proxy-factory branch September 24, 2017 15:09
guilhermeblanco pushed a commit that referenced this pull request Dec 4, 2017
lcobucci pushed a commit to lcobucci/doctrine2 that referenced this pull request Dec 31, 2017
lcobucci pushed a commit to lcobucci/doctrine2 that referenced this pull request Dec 31, 2017
maglnet pushed a commit to maglnet/doctrine2 that referenced this pull request Oct 10, 2018
maglnet pushed a commit to maglnet/doctrine2 that referenced this pull request Oct 10, 2018
@greg0ire greg0ire removed this from the 3.0.0 milestone Jun 27, 2021
@carnage
Copy link
Contributor

carnage commented Jul 24, 2021

Done a quick scan of the diff and this seems to be a massive BC break (literally spelled out in upgrading.md); should it not be targetting 3.0.x not 2.10.x ?

@greg0ire
Copy link
Member

I'm AFK for a week and I don't remember what the plan was here. @beberlei, can you please advise?

@Ocramius
Copy link
Member Author

This should really land in 3.x, as the type of the proxies changes completely.

@beberlei
Copy link
Member

Its not really a madsive BC break as the Proxy interface is mostly internal.

The idea is, when possible and i think that might be, a user should be able to decide which proxy generator to use via config, which would allow downstreams to gradually prepare for 3.0.

That would require proxy manager to be flexible enough to also implement our Proxy interface if possible. Otherwise we can provide APIs that would enable forward compatibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants