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

This commit is contained in:
John Bohn 2012-01-23 10:54:35 -06:00 committed by Kris Wallsmith
parent f6b4f89f8f
commit 6e75fd16c8

View File

@ -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';