Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

ProxyFactory was redeclaring methods in some OSs #177

Merged
merged 1 commit into from over 2 years ago

4 participants

Thiago Festa Benjamin Eberlei Miha Vrhovnik Lihong
Thiago Festa

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

Benjamin Eberlei
Owner

On what PHP version did this happen for you?

Thiago Festa

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.

Miha Vrhovnik

iouncube or ZendGuards fault?

Thiago Festa

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.

Miha Vrhovnik

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.

Lihong

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!

Benjamin Eberlei
Owner

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

Thiago Festa

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

Benjamin Eberlei beberlei merged commit 66d2b9e into from November 13, 2011
Benjamin Eberlei beberlei closed this November 13, 2011
Benjamin Eberlei
Owner

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

Thiago Festa

Great, Thanks!

Lihong

thanks!

elHornair elHornair referenced this pull request from a commit February 22, 2013
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

Showing 1 unique commit by 1 author.

Oct 28, 2011
Thiago Festa The ProxyFactory was redeclaring methods serialize and unserialize on…
… the cache file on some OSs.
66d2b9e
This page is out of date. Refresh to see the latest.
2  lib/Doctrine/ORM/Proxy/ProxyFactory.php
@@ -167,7 +167,7 @@ private function _generateMethods(ClassMetadata $class)
167 167
 
168 168
         foreach ($class->reflClass->getMethods() as $method) {
169 169
             /* @var $method ReflectionMethod */
170  
-            if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone"))) {
  170
+            if ($method->isConstructor() || in_array(strtolower($method->getName()), array("__sleep", "__clone")) || $class->reflClass->getName() != $method->class) {
171 171
                 continue;
172 172
             }
173 173
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.