2

I am trying to mix doctrine 2 along with Zend framework, and I am using Zend auto loader. so All my Entities is looked like

TEST_ORM_Entities_User under TEST/ORM/Entites/User.php

but there is a problem with serialization since all proxies will look like

Pocks\ORM\Proxies\TEST_ORM_Entities_UserProxy under TEST/ORM/Proxies/TEST_ORM_Entities_UserProxy.php

So doctine can't find my proxy classes, and when I check my cache I found it corrupted

object(__PHP_Incomplete_Class)#175 (19) {
  ["__PHP_Incomplete_Class_Name"]=>
  string(46) "TEST\ORM\Proxies\TEST_ORM_Entities_UserProxy"

Any Idea how we can explicitly put the Proxy File Name, or solving this issue?

edigu
  • 9,878
  • 5
  • 57
  • 80
Ehab Al-Hakawati
  • 982
  • 4
  • 11
  • 32

1 Answers1

1

We ran into the same problem in the past, and ended up converting our application to use namespaces as well.

We still use Zend Framework 1.x and its pseudo-namespace convention, but all of our application classes are namespaced thanks to this fix.

Now our code looks like:

<?php

namespace Application\Form;
use Zend_Form as Form;

class UserForm extends Form
{
    // ...
}

And we can refer to this class by Application\Form\UserForm anywhere in the code, thanks to the autoloader fix!

Community
  • 1
  • 1
BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • Yeh, look like a good answer, but I create a different solution, I changed the proxies location (namespace) out of the Zend autoloader, so zend can't see my proxies anymore :) – Ehab Al-Hakawati Dec 04 '11 at 08:11