Doctrine Common
  1. Doctrine Common
  2. DCOM-39

It is not possible to load multiple directories under the same namespace

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: Class Loading
    • Labels:
      None

      Description

      Consider the following code snippet:

      $loader = new ClassLoader('DoctrineExtensions',
         "/path/to/vendor/doctrine2-extensions-beberlei/lib");
      $loader->register();
      
      $loader = new ClassLoader('DoctrineExtensions',
         "/path/to/vendor/doctrine2-extensions-srosato/lib");
      $loader->register();
      

      The latter will not be able to be loaded since the documentation specifies (with good reason) that class loaders do not fail silently. Is there a workaround for this issue?

        Activity

        Hide
        Steven Rosato added a comment -

        Or maybe this is intentional, such as authors that write separate doctrine extensions (according to this exemple) must define their own namespace.

        Show
        Steven Rosato added a comment - Or maybe this is intentional, such as authors that write separate doctrine extensions (according to this exemple) must define their own namespace.
        Hide
        Benjamin Eberlei added a comment -

        This is desired behavior, you need to pass a more specific path like "DoctrineExtensions/Versionable" + "DoctrineExtensions/Paginate" and so on...

        Show
        Benjamin Eberlei added a comment - This is desired behavior, you need to pass a more specific path like "DoctrineExtensions/Versionable" + "DoctrineExtensions/Paginate" and so on...

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Steven Rosato
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: