[DDC-2399] unserializing returns proxyclass name with slashes Created: 12/Apr/13  Updated: 12/Apr/13  Resolved: 12/Apr/13

Status: Closed
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.3.3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Quintenvk Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None
Environment:

OSX, PHP 5.4.9



 Description   

I serialize a "user"-entity using the following code:

$user->getBusinessid()->getId(); //this is necessary to load the proxy
$em->detach($user);
$_SESSION['user'] = serialize($user);

When I unserialize said entity with this code:

$em = self::getEntityManager();
$user = unserialize($_SESSION['user']);
return $em->merge($user);

I get an error like this:
require(): Failed opening required './core/project/Proxy/_CG_/core/project/Entity/Businesses.php' .

The thing is that everything after _CG_ should not have any forward slashes. In that case the path would be completely correct.



 Comments   
Comment by Marco Pivetta [ 12/Apr/13 ]

There's an appositely coded autoloader in the ORM in 2.3 ( https://github.com/doctrine/doctrine2/blob/2.3.3/lib/Doctrine/ORM/Proxy/Autoloader.php ) and in common in 2.4-RC ( https://github.com/doctrine/common/blob/2.4.0-RC1/lib/Doctrine/Common/Proxy/Autoloader.php ). Proxies are not PSR-0 compliant

Comment by Quintenvk [ 12/Apr/13 ]

Ah, I hadn't found anything about that. Thank you!

Generated at Sun Aug 31 08:19:00 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.