Doctrine Migrations
  1. Doctrine Migrations
  2. DMIG-6

Put Migrations under own namespace to avoid problems with Autoloader

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None

      Description

      I think it would be a good idea to put the Migrations classes under their own namespace. If you use \Doctrine\Common\ClassLoader for loading both, DBAL and Migrations, you need to load Migrations before DBAL to avoid raising an exception.

      Throws exception:

      $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(APPLICATION_PATH . '/../library/Doctrine/DBAL/lib'));
      $classLoader->register();
      $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL\Migrations', realpath(APPLICATION_PATH . '/../library/Doctrine/Migrations/lib'));
      $classLoader->register();
      

      Works:

      $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL\Migrations', realpath(APPLICATION_PATH . '/../library/Doctrine/Migrations/lib'));
      $classLoader->register();
      $classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', realpath(APPLICATION_PATH . '/../library/Doctrine/DBAL/lib'));
      $classLoader->register();
      

        Activity

        Marcus Stöhr created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Assignee Jonathan H. Wage [ jwage ] Benjamin Eberlei [ beberlei ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Marcus Stöhr
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: