Skip to content


Subversion checkout URL

You can clone with
Download ZIP


ProxyFactory was redeclaring methods in some OSs #177

merged 1 commit into from

4 participants


The ProxyFactory was redeclaring methods serialize and unserialize (in my case) on the cache file on some OSs.

Here is the full comment with some screenshots: symfony/symfony#2501


On what PHP version did this happen for you?


beberlei, here i mentioned the versions: symfony/symfony#2501 (comment)

As i said, it just occurs on my server, but i made some debugs there, and i noticed that on that classe the getMethods of reflection class bring the methods serialize and unserialize from my entity and from Serializable class.

My Change make sure that the reflection just get the methods from my entity, not from other entities. I read about reflection and getMethods on php documentation.

I hope that help.


iouncube or ZendGuards fault?


ZendGuard and ioncube... i don't think so... why? but can be.

Can I ask you guys a thing. The ProxyFactory should generate just the methods from my entity right? So this way we fix that.

Of course, it is some incompatibility of PHP with some module, or PHP build of my Server. But i think this way we will fix that, as well other problems with other guys that are the same as mine.


because If it's fault of one external's modules this ALSO has to go to their bugtracker. Doctrine code is probably not the only one that's not working properly.


I got the same problem for days, I try to use php5.3.2, 5.3.6, 5.3.8,
my local(Mac, php5.3.2) works fine, but when I deploy it to the server(Debian, php5.3.6/8), the weird issue occured.

Google it, some people got same problem but there's no official resolution, thanks God, I find out @thiagofesfa's solution, it works for me.

I really hope Doctrine2.0 team can fix that, thank you guys!


This PR breaks the tests in special cases with mapped superclasses, i will evaluate it a bit more.


Hi beberlei, try this solution:
symfony/symfony#2501 (comment)

@beberlei beberlei merged commit 66d2b9e into doctrine:master

I did something similar as you can see in the final commit.


Great, Thanks!



@elHornair elHornair referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 28, 2011
  1. @thiagofesta

    The ProxyFactory was redeclaring methods serialize and unserialize on…

    thiagofesta authored
    … the cache file on some OSs.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Doctrine/ORM/Proxy/ProxyFactory.php
2  lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -167,7 +167,7 @@ private function _generateMethods(ClassMetadata $class)
foreach ($class->reflClass->getMethods() as $method) {
/* @var $method ReflectionMethod */
- if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone"))) {
+ if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone")) || $class->reflClass->getName() != $method->class) {
Something went wrong with that request. Please try again.