src/Zend/Loader/Autoloader/Resource.php
public function getClassPath($class)
    {
        $segments          = explode('_', $class);
        $namespaceTopLevel = $this->getNamespace();
        $namespace         = '';

        if (!empty($namespaceTopLevel)) {
            $namespace = array();
            $topLevelSegments = count(explode('_', $namespaceTopLevel));
            for ($i = 0; $i < $topLevelSegments; $i++) {
                $namespace[] = array_shift($segments);
            }
            $namespace = implode('_', $namespace);
            if ($namespace != $namespaceTopLevel) {
                // wrong prefix? we're done
                return false;
            }
        }

        if (count($segments) < 2) {
            // assumes all resources have a component and class name, minimum
            return false;
        }

        $final     = array_pop($segments);
        $component = $namespace;
        $lastMatch = false;
        do {
            $segment    = array_shift($segments);
            $component .= empty($component) ? $segment : '_' . $segment;
            if (isset($this->_components[$component])) {
                $lastMatch = $component;
            }
        } while (count($segments));

        if (!$lastMatch) {
            return false;
        }

        $final = substr($class, strlen($lastMatch) + 1);
        $path = $this->_components[$lastMatch];
        $classPath = $path . '/' . str_replace('_', '/', $final) . '.php';

        if (Zend_Loader::isReadable($classPath)) {
            return $classPath;
        }

        return false;
    }
public function getClassPath($class)
    {
        $segments          = explode('_', $class);
        $namespaceTopLevel = $this->getNamespace();
        $namespace         = '';

        if (!empty($namespaceTopLevel)) {
            $namespace = array();
            $topLevelSegments = count(explode('_', $namespaceTopLevel));
            for ($i = 0; $i < $topLevelSegments; $i++) {
                $namespace[] = array_shift($segments);
            }
            $namespace = implode('_', $namespace);
            if ($namespace != $namespaceTopLevel) {
                // wrong prefix? we're done
                return false;
            }
        }

        if (count($segments) < 2) {
            // assumes all resources have a component and class name, minimum
            return false;
        }

        $final     = array_pop($segments);
        $component = $namespace;
        $lastMatch = false;
        do {
            $segment    = array_shift($segments);
            $component .= empty($component) ? $segment : '_' . $segment;
            if (isset($this->_components[$component])) {
                $lastMatch = $component;
            }
        } while (count($segments));

        if (!$lastMatch) {
            return false;
        }

        $final = substr($class, strlen($lastMatch) + 1);
        $path = $this->_components[$lastMatch];
        $classPath = $path . '/' . str_replace('_', '/', $final) . '.php';

        if (Zend_Loader::isReadable($classPath)) {
            return $classPath;
        }

        return false;
    }
public function getClassPath ( $ class ) { $ segments = explode ( '_' , $ class ) ; $ namespaceTopLevel = $ this -> getNamespace ( ) ; $ namespace = '' ; if ( ! empty ( $ namespaceTopLevel ) ) { $ namespace = array ( ) ; $ topLevelSegments = count ( explode ( '_' , $ namespaceTopLevel ) ) ; for ( $ i = 0 ; $ i < $ topLevelSegments ; $ i ++ ) { $ namespace [ ] = array_shift ( $ segments ) ; } $ namespace = implode ( '_' , $ namespace ) ; if ( $ namespace != $ namespaceTopLevel ) { // wrong prefix? we're done return false ; } } if ( count ( $ segments ) < 2 ) { // assumes all resources have a component and class name, minimum return false ; } $ final = array_pop ( $ segments ) ; $ component = $ namespace ; $ lastMatch = false ; do { $ segment = array_shift ( $ segments ) ; $ component .= empty ( $ component ) ? $ segment : '_' . $ segment ; if ( isset ( $ this -> _components [ $ component ] ) ) { $ lastMatch = $ component ; } } while ( count ( $ segments ) ) ; if ( ! $ lastMatch ) { return false ; } $ final = substr ( $ class , strlen ( $ lastMatch ) + 1 ) ; $ path = $ this -> _components [ $ lastMatch ] ; $ classPath = $ path . '/' . str_replace ( '_' , '/' , $ final ) . '.php' ; if ( Zend_Loader :: isReadable ( $ classPath ) ) { return $ classPath ; } return false ; }
Helper method to calculate the correct class path

@param string $class
@return False if not matched other wise the correct path
Helper method to calculate the correct class path