Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed the autoloader and removed the exception

The execption has been removed in DoctrineBundle a few days ago.
  • Loading branch information...
commit 1ca46b8a9f7e81a84a53d4c5a6a066524631356f 1 parent 1180918
@stof stof authored
Showing with 5 additions and 6 deletions.
  1. +5 −6 DoctrineMongoDBBundle.php
View
11 DoctrineMongoDBBundle.php
@@ -14,6 +14,7 @@
namespace Doctrine\Bundle\MongoDBBundle;
+use Doctrine\Common\Util\ClassUtils;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\CreateHydratorDirectoryPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\CreateProxyDirectoryPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension;
@@ -69,7 +70,7 @@ public function boot()
$file = $dir.DIRECTORY_SEPARATOR.$className.'.php';
if (!is_file($file) && $container->getParameter('kernel.debug')) {
- $originalClassName = substr($className, 0, -5);
+ $originalClassName = ClassUtils::getRealClass($class);
$registry = $container->get('doctrine.odm.mongodb');
// Tries to auto-generate the proxy file
@@ -89,13 +90,11 @@ public function boot()
}
clearstatcache($file);
-
- if (!is_file($file)) {
- throw new \RuntimeException(sprintf('The proxy file "%s" does not exist. If you still have objects serialized in the session, you need to clear the session manually.', $file));
- }
}
- require $file;
+ if (is_file($file)) {
+ require $file;
+ }
}
};
spl_autoload_register($this->autoloader);
Please sign in to comment.
Something went wrong with that request. Please try again.