Doctrine Common
  1. Doctrine Common
  2. DCOM-47

When using different class loaders

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.2
    • Component/s: Class Loading
    • Labels:
      None
    • Environment:
      all

      Description

      ClassLoader::classExists($class); will fail if different class loader is used which does not return any boolean value. This includes Symfony2 UniversalClassLoader

      I have never used this function before because native PHP method class_exits($class, true) first will try to autoload. But if the class does not exist
      and you are using Doctrine\Common::ClassLoader and you call class_exists($class) it will trigger fatal error. This behavior makes it impossible to make code compatible
      with different class loading mechanisms for Doctrine2

        Activity

        Gediminas Morkevicius created issue -
        Show
        Christophe Coevoet added a comment - This is known and documented in the code: https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Annotations/Parser.php#L110
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Fix Version/s 2.1.1 [ 10155 ]
        Fix Version/s 2.1 [ 10123 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.1.2 [ 10161 ]
        Fix Version/s 2.1.1 [ 10155 ]
        Hide
        Guilherme Blanco added a comment -

        Since Annotations package changed a lot since the bug was opened and today, I'm closing the ticket as "Cannot reproduce".

        Please reopen it if the issue is still valid with a testcase.

        Cheers,

        Show
        Guilherme Blanco added a comment - Since Annotations package changed a lot since the bug was opened and today, I'm closing the ticket as "Cannot reproduce". Please reopen it if the issue is still valid with a testcase. Cheers,
        Guilherme Blanco made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Benjamin Eberlei [ beberlei ] Guilherme Blanco [ guilhermeblanco ]
        Resolution Cannot Reproduce [ 5 ]
        Hide
        Benjamin Eberlei added a comment -

        This issue is referenced in Github Pull-Request GH-88
        https://github.com/doctrine/common/pull/88

        Show
        Benjamin Eberlei added a comment - This issue is referenced in Github Pull-Request GH-88 https://github.com/doctrine/common/pull/88
        Hide
        Jan Dolecek added a comment -

        Still a problem! Especially since this is used by ORM (https://github.com/doctrine/doctrine2/commit/3aea203b9ca77df65f55f036080a9af653194cbf)

        Class loader doesn't have to return bool (and usually DOES NOT), so even though it has loaded the class, classExists will return false. Please pull this https://github.com/doctrine/common/pull/88

        Show
        Jan Dolecek added a comment - Still a problem! Especially since this is used by ORM ( https://github.com/doctrine/doctrine2/commit/3aea203b9ca77df65f55f036080a9af653194cbf ) Class loader doesn't have to return bool (and usually DOES NOT), so even though it has loaded the class, classExists will return false. Please pull this https://github.com/doctrine/common/pull/88
        Hide
        Benjamin Eberlei added a comment -

        Related Pull Request was closed: https://github.com/doctrine/common/pull/88

        Show
        Benjamin Eberlei added a comment - Related Pull Request was closed: https://github.com/doctrine/common/pull/88
        Benjamin Eberlei made changes -
        Workflow jira [ 12543 ] jira-feedback2 [ 17893 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17893 ] jira-feedback3 [ 19856 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DCOM-47, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Gediminas Morkevicius
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: