src/Zend/Loader/Autoloader.php
public function getClassAutoloaders($class)
    {
        $namespace   = false;
        $autoloaders = array();

        // Add concrete namespaced autoloaders
        foreach (array_keys($this->_namespaceAutoloaders) as $ns) {
            if ('' == $ns) {
                continue;
            }
            if (0 === strpos($class, $ns)) {
                if ((false === $namespace) || (strlen($ns) > strlen($namespace))) {
                    $namespace = $ns;
                    $autoloaders = $this->getNamespaceAutoloaders($ns);
                }
            }
        }

        // Add internal namespaced autoloader
        foreach ($this->getRegisteredNamespaces() as $ns) {
            if (0 === strpos($class, $ns)) {
                $namespace     = $ns;
                $autoloaders[] = $this->_internalAutoloader;
                break;
            }
        }

        // Add non-namespaced autoloaders
        $autoloadersNonNamespace = $this->getNamespaceAutoloaders('');
        if (count($autoloadersNonNamespace)) {
            foreach ($autoloadersNonNamespace as $ns) {
                $autoloaders[] = $ns;
            }
            unset($autoloadersNonNamespace);
        }

        // Add fallback autoloader
        if (!$namespace && $this->isFallbackAutoloader()) {
            $autoloaders[] = $this->_internalAutoloader;
        }

        return $autoloaders;
    }
public function getClassAutoloaders($class)
    {
        $namespace   = false;
        $autoloaders = array();

        // Add concrete namespaced autoloaders
        foreach (array_keys($this->_namespaceAutoloaders) as $ns) {
            if ('' == $ns) {
                continue;
            }
            if (0 === strpos($class, $ns)) {
                if ((false === $namespace) || (strlen($ns) > strlen($namespace))) {
                    $namespace = $ns;
                    $autoloaders = $this->getNamespaceAutoloaders($ns);
                }
            }
        }

        // Add internal namespaced autoloader
        foreach ($this->getRegisteredNamespaces() as $ns) {
            if (0 === strpos($class, $ns)) {
                $namespace     = $ns;
                $autoloaders[] = $this->_internalAutoloader;
                break;
            }
        }

        // Add non-namespaced autoloaders
        $autoloadersNonNamespace = $this->getNamespaceAutoloaders('');
        if (count($autoloadersNonNamespace)) {
            foreach ($autoloadersNonNamespace as $ns) {
                $autoloaders[] = $ns;
            }
            unset($autoloadersNonNamespace);
        }

        // Add fallback autoloader
        if (!$namespace && $this->isFallbackAutoloader()) {
            $autoloaders[] = $this->_internalAutoloader;
        }

        return $autoloaders;
    }
public function getClassAutoloaders ( $ class ) { $ namespace = false ; $ autoloaders = array ( ) ; // Add concrete namespaced autoloaders foreach ( array_keys ( $ this -> _namespaceAutoloaders ) as $ ns ) { if ( '' == $ ns ) { continue ; } if ( 0 === strpos ( $ class , $ ns ) ) { if ( ( false === $ namespace ) || ( strlen ( $ ns ) > strlen ( $ namespace ) ) ) { $ namespace = $ ns ; $ autoloaders = $ this -> getNamespaceAutoloaders ( $ ns ) ; } } } // Add internal namespaced autoloader foreach ( $ this -> getRegisteredNamespaces ( ) as $ ns ) { if ( 0 === strpos ( $ class , $ ns ) ) { $ namespace = $ ns ; $ autoloaders [ ] = $ this -> _internalAutoloader ; break ; } } // Add non-namespaced autoloaders $ autoloadersNonNamespace = $ this -> getNamespaceAutoloaders ( '' ) ; if ( count ( $ autoloadersNonNamespace ) ) { foreach ( $ autoloadersNonNamespace as $ ns ) { $ autoloaders [ ] = $ ns ; } unset ( $ autoloadersNonNamespace ) ; } // Add fallback autoloader if ( ! $ namespace && $ this -> isFallbackAutoloader ( ) ) { $ autoloaders [ ] = $ this -> _internalAutoloader ; } return $ autoloaders ; }
Get autoloaders to use when matching class

Determines if the class matches a registered namespace, and, if so,
returns only the autoloaders for that namespace. Otherwise, it returns
all non-namespaced autoloaders.

@param  string $class
@return array Array of autoloaders to use
Get autoloaders to use when matching class