DDC-1313 - Optimize behavior of DriverChain::getAllClassNames()
This commit is contained in:
parent
e12a5fb328
commit
ba882be76b
@ -88,15 +88,20 @@ class DriverChain implements Driver
|
|||||||
public function getAllClassNames()
|
public function getAllClassNames()
|
||||||
{
|
{
|
||||||
$classNames = array();
|
$classNames = array();
|
||||||
|
$driverClasses = array();
|
||||||
foreach ($this->_drivers AS $namespace => $driver) {
|
foreach ($this->_drivers AS $namespace => $driver) {
|
||||||
$driverClasses = $driver->getAllClassNames();
|
$oid = spl_object_hash($driver);
|
||||||
foreach ($driverClasses AS $className) {
|
if (!isset($driverClasses[$oid])) {
|
||||||
|
$driverClasses[$oid] = $driver->getAllClassNames();
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($driverClasses[$oid] AS $className) {
|
||||||
if (strpos($className, $namespace) === 0) {
|
if (strpos($className, $namespace) === 0) {
|
||||||
$classNames[] = $className;
|
$classNames[$className] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return array_unique($classNames);
|
return array_keys($classNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user