Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1104

Require statement in AnnotationDriver.php can cause PHP Fatal error

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Git Master
    • Fix Version/s: 2.1
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      Linux

      Description

      The require statement in Doctrine/ORM/Mapping/Driver/AnnotationDriver.php causes troubles in some cases. Imagine the situation when you're creating your own class loader which maps all classes and loads all requested classes lazily. When it loads any class from DoctrineAnnotations.php before loading AnnotationDriver and this class is loaded later, you get: PHP Fatal error: Cannot redeclare class ....

      Changing require to require_once solves the problem.

      Pull request: https://github.com/doctrine/doctrine2/pull/45

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This was fixed for 2.1

        Show
        Benjamin Eberlei added a comment - This was fixed for 2.1

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Michael Moravec
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: