src/Zend/Loader/Autoloader.php
protected function _getAvailableVersions($path, $version)
    {
        if (!is_dir($path)) {
            throw new Zend_Loader_Exception('Invalid ZF path provided');
        }

        $path       = rtrim($path, '/');
        $path       = rtrim($path, '\\');
        $versionLen = strlen($version);
        $versions   = array();
        $dirs       = glob("$path/*", GLOB_ONLYDIR);
        foreach ((array) $dirs as $dir) {
            $dirName = substr($dir, strlen($path) + 1);
            if (!preg_match('/^(?:ZendFramework-)?(\d+\.\d+\.\d+((a|b|pl|pr|p|rc)\d+)?)(?:-minimal)?$/i', $dirName, $matches)) {
                continue;
            }

            $matchedVersion = $matches[1];

            if (('latest' == $version)
                || ((strlen($matchedVersion) >= $versionLen)
                    && (0 === strpos($matchedVersion, $version)))
            ) {
                $versions[$matchedVersion] = $dir . '/library';
            }
        }

        uksort($versions, 'version_compare');
        return $versions;
    }
protected function _getAvailableVersions($path, $version)
    {
        if (!is_dir($path)) {
            throw new Zend_Loader_Exception('Invalid ZF path provided');
        }

        $path       = rtrim($path, '/');
        $path       = rtrim($path, '\\');
        $versionLen = strlen($version);
        $versions   = array();
        $dirs       = glob("$path/*", GLOB_ONLYDIR);
        foreach ((array) $dirs as $dir) {
            $dirName = substr($dir, strlen($path) + 1);
            if (!preg_match('/^(?:ZendFramework-)?(\d+\.\d+\.\d+((a|b|pl|pr|p|rc)\d+)?)(?:-minimal)?$/i', $dirName, $matches)) {
                continue;
            }

            $matchedVersion = $matches[1];

            if (('latest' == $version)
                || ((strlen($matchedVersion) >= $versionLen)
                    && (0 === strpos($matchedVersion, $version)))
            ) {
                $versions[$matchedVersion] = $dir . '/library';
            }
        }

        uksort($versions, 'version_compare');
        return $versions;
    }
protected function _getAvailableVersions ( $ path , $ version ) { if ( ! is_dir ( $ path ) ) { throw new Zend_Loader_Exception ( 'Invalid ZF path provided' ) ; } $ path = rtrim ( $ path , '/' ) ; $ path = rtrim ( $ path , '\\' ) ; $ versionLen = strlen ( $ version ) ; $ versions = array ( ) ; $ dirs = glob ( "$path/*" , GLOB_ONLYDIR ) ; foreach ( ( array ) $ dirs as $ dir ) { $ dirName = substr ( $ dir , strlen ( $ path ) + 1 ) ; if ( ! preg_match ( '/^(?:ZendFramework-)?(\d+\.\d+\.\d+((a|b|pl|pr|p|rc)\d+)?)(?:-minimal)?$/i' , $ dirName , $ matches ) ) { continue ; } $ matchedVersion = $ matches [ 1 ] ; if ( ( 'latest' == $ version ) || ( ( strlen ( $ matchedVersion ) >= $ versionLen ) && ( 0 === strpos ( $ matchedVersion , $ version ) ) ) ) { $ versions [ $ matchedVersion ] = $ dir . '/library' ; } } uksort ( $ versions , 'version_compare' ) ; return $ versions ; }
Get available versions for the version type requested

@param  string $path
@param  string $version
@return array
Get available versions for the version type requested