1
0
mirror of synced 2025-01-18 06:21:40 +03:00

DDC-1313 - Optimize behavior of DriverChain::getAllClassNames()

This commit is contained in:
Benjamin Eberlei 2011-08-01 21:45:21 +02:00
parent e12a5fb328
commit ba882be76b

View File

@ -88,15 +88,20 @@ class DriverChain implements Driver
public function getAllClassNames()
{
$classNames = array();
$driverClasses = array();
foreach ($this->_drivers AS $namespace => $driver) {
$driverClasses = $driver->getAllClassNames();
foreach ($driverClasses AS $className) {
$oid = spl_object_hash($driver);
if (!isset($driverClasses[$oid])) {
$driverClasses[$oid] = $driver->getAllClassNames();
}
foreach ($driverClasses[$oid] AS $className) {
if (strpos($className, $namespace) === 0) {
$classNames[] = $className;
$classNames[$className] = true;
}
}
}
return array_unique($classNames);
return array_keys($classNames);
}
/**