File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/Symfony/Bundle/DoctrineBundle Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 24
24
*/
25
25
class DoctrineBundle extends Bundle
26
26
{
27
+ private $ autoloader ;
28
+
27
29
public function build (ContainerBuilder $ container )
28
30
{
29
31
parent ::build ($ container );
@@ -44,7 +46,7 @@ class_exists('Doctrine\ORM\Mapping\Driver\AnnotationDriver');
44
46
$ dir = $ this ->container ->getParameter ('doctrine.orm.proxy_dir ' );
45
47
$ container =& $ this ->container ;
46
48
47
- spl_autoload_register ( function ($ class ) use ($ namespace , $ dir , &$ container ) {
49
+ $ this -> autoloader = function ($ class ) use ($ namespace , $ dir , &$ container ) {
48
50
if (0 === strpos ($ class , $ namespace )) {
49
51
$ className = substr ($ class , strlen ($ namespace ) +1 );
50
52
$ file = $ dir .DIRECTORY_SEPARATOR .$ className .'.php ' ;
@@ -78,7 +80,16 @@ class_exists('Doctrine\ORM\Mapping\Driver\AnnotationDriver');
78
80
79
81
require $ file ;
80
82
}
81
- });
83
+ };
84
+ spl_autoload_register ($ this ->autoloader );
85
+ }
86
+ }
87
+
88
+ public function shutdown ()
89
+ {
90
+ if (null !== $ this ->autoloader ) {
91
+ spl_autoload_unregister ($ this ->autoloader );
92
+ $ this ->autoloader = null ;
82
93
}
83
94
}
84
95
}
You can’t perform that action at this time.
0 commit comments