[ClassLoader] Fix declared classes being computed when not needed
This commit is contained in:
parent
0259bedec1
commit
d513eae29e
@ -43,12 +43,12 @@ class ClassCollectionLoader
|
||||
|
||||
self::$loaded[$name] = true;
|
||||
|
||||
$declared = array_merge(get_declared_classes(), get_declared_interfaces());
|
||||
if (function_exists('get_declared_traits')) {
|
||||
$declared = array_merge($declared, get_declared_traits());
|
||||
}
|
||||
|
||||
if ($adaptive) {
|
||||
$declared = array_merge(get_declared_classes(), get_declared_interfaces());
|
||||
if (function_exists('get_declared_traits')) {
|
||||
$declared = array_merge($declared, get_declared_traits());
|
||||
}
|
||||
|
||||
// don't include already declared classes
|
||||
$classes = array_diff($classes, $declared);
|
||||
|
||||
@ -87,11 +87,17 @@ class ClassCollectionLoader
|
||||
}
|
||||
}
|
||||
|
||||
if (!$reload && is_file($cache)) {
|
||||
if (!$reload && file_exists($cache)) {
|
||||
require_once $cache;
|
||||
|
||||
return;
|
||||
}
|
||||
if (!$adaptive) {
|
||||
$declared = array_merge(get_declared_classes(), get_declared_interfaces());
|
||||
if (function_exists('get_declared_traits')) {
|
||||
$declared = array_merge($declared, get_declared_traits());
|
||||
}
|
||||
}
|
||||
|
||||
$files = array();
|
||||
$content = '';
|
||||
|
Reference in New Issue
Block a user