Bläddra i källkod

Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure.

John Bohn 13 år sedan
förälder
incheckning
6e75fd16c8
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php

+ 2 - 2
src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php

@@ -42,9 +42,9 @@ class DoctrineBundle extends Bundle
         if ($this->container->hasParameter('doctrine.orm.proxy_namespace')) {
             $namespace = $this->container->getParameter('doctrine.orm.proxy_namespace');
             $dir = $this->container->getParameter('doctrine.orm.proxy_dir');
-            $container = $this->container;
+            $container =& $this->container;
 
-            spl_autoload_register(function($class) use ($namespace, $dir, $container) {
+            spl_autoload_register(function($class) use ($namespace, $dir, &$container) {
                 if (0 === strpos($class, $namespace)) {
                     $className = substr($class, strlen($namespace) +1);
                     $file = $dir.DIRECTORY_SEPARATOR.$className.'.php';