浏览代码

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

John Bohn 13 年之前
父节点
当前提交
6e75fd16c8
共有 1 个文件被更改,包括 2 次插入2 次删除
  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';