Skip to content

Commit 209711f

Browse files
committed
Readd autoloading of annotations
1 parent 5e958b9 commit 209711f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

bootstrap/bootstrap.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@
1111
'php composer.phar install'.$nl);
1212
}
1313

14+
use Doctrine\Common\Annotations\AnnotationRegistry;
15+
16+
AnnotationRegistry::registerLoader(function($class) use ($loader) {
17+
$loader->loadClass($class);
18+
19+
// this was class_exists($class, false) i.e. do not autoload.
20+
// this is required so that custom annotations (e.g. TreeUiBundle
21+
// annotations) are autoloaded - but they should be found by the
22+
// composer loader above.
23+
//
24+
// This probably slows things down.
25+
//
26+
// @todo: Fix me.
27+
return class_exists($class);
28+
});
29+
1430
if (!defined('CMF_TEST_ROOT_DIR')) {
1531
define('CMF_TEST_ROOT_DIR', realpath(__DIR__.'/..'));
1632
}

0 commit comments

Comments
 (0)