From 6e75fd16c85d563d3e98a5541cc78645639ce4c8 Mon Sep 17 00:00:00 2001 From: John Bohn Date: Mon, 23 Jan 2012 10:54:35 -0600 Subject: [PATCH] Resolves issue with spl_autoload_register creating new copies of the container and passing that into the closure. --- src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php b/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php index 2ef73a3839d6..7bd97e942158 100644 --- a/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php +++ b/src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php @@ -42,9 +42,9 @@ class_exists('Doctrine\ORM\Mapping\Driver\AnnotationDriver'); 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';