Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1698

Inconsistent proxy file name & namespace result in __PHP_Incomplete_Class when unserializing entities

    Details

    • Type: Improvement Improvement
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2, 2.2.1, 2.3, 2.4
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:

      Description

      Starting with Doctrine 2.2, the Proxy classes have inconsistent naming with their file name, which raises problems with class autoloading.
      For example, a class named Application\Model\User creates the following proxy class:

      Application\Proxy\__CG__\Application\Model\User
      

      This class is located in the following file:

      Application/Proxy/__CG__ApplicationModelUser.php
      

      But whe we serialize such an entity, then unserialize it in another session, the framework autoloader expects the class to be located in:

      Application/Proxy/__CG__/Application/Model/User.php
      

      But it is not.
      As a result, a __PHP_Incomplete_Class is created instead of the expected proxy class.

      I'm not sure whether this is an intended behavior, but I would assume this is a bug.

        Activity

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Benjamin Morel
          • Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: