function isCompatible($pf)
    {
        if (!isset($this->_packageInfo['compatible'])) {
            return false;
        }
        if (!isset($this->_packageInfo['channel'])) {
            return false;
        }
        $me = $pf->getVersion();
        $compatible = $this->_packageInfo['compatible'];
        if (!isset($compatible[0])) {
            $compatible = array($compatible);
        }
        $found = false;
        foreach ($compatible as $info) {
            if (strtolower($info['name']) == strtolower($pf->getPackage())) {
                if (strtolower($info['channel']) == strtolower($pf->getChannel())) {
                    $found = true;
                    break;
                }
            }
        }
        if (!$found) {
            return false;
        }
        if (isset($info['exclude'])) {
            if (!isset($info['exclude'][0])) {
                $info['exclude'] = array($info['exclude']);
            }
            foreach ($info['exclude'] as $exclude) {
                if (version_compare($me, $exclude, '==')) {
                    return false;
                }
            }
        }
        if (version_compare($me, $info['min'], '>=') && version_compare($me, $info['max'], '<=')) {
            return true;
        }
        return false;
    }
function isCompatible($pf)
    {
        if (!isset($this->_packageInfo['compatible'])) {
            return false;
        }
        if (!isset($this->_packageInfo['channel'])) {
            return false;
        }
        $me = $pf->getVersion();
        $compatible = $this->_packageInfo['compatible'];
        if (!isset($compatible[0])) {
            $compatible = array($compatible);
        }
        $found = false;
        foreach ($compatible as $info) {
            if (strtolower($info['name']) == strtolower($pf->getPackage())) {
                if (strtolower($info['channel']) == strtolower($pf->getChannel())) {
                    $found = true;
                    break;
                }
            }
        }
        if (!$found) {
            return false;
        }
        if (isset($info['exclude'])) {
            if (!isset($info['exclude'][0])) {
                $info['exclude'] = array($info['exclude']);
            }
            foreach ($info['exclude'] as $exclude) {
                if (version_compare($me, $exclude, '==')) {
                    return false;
                }
            }
        }
        if (version_compare($me, $info['min'], '>=') && version_compare($me, $info['max'], '<=')) {
            return true;
        }
        return false;
    }
function isCompatible ( $ pf ) { if ( ! isset ( $ this -> _packageInfo [ 'compatible' ] ) ) { return false ; } if ( ! isset ( $ this -> _packageInfo [ 'channel' ] ) ) { return false ; } $ me = $ pf -> getVersion ( ) ; $ compatible = $ this -> _packageInfo [ 'compatible' ] ; if ( ! isset ( $ compatible [ 0 ] ) ) { $ compatible = array ( $ compatible ) ; } $ found = false ; foreach ( $ compatible as $ info ) { if ( strtolower ( $ info [ 'name' ] ) == strtolower ( $ pf -> getPackage ( ) ) ) { if ( strtolower ( $ info [ 'channel' ] ) == strtolower ( $ pf -> getChannel ( ) ) ) { $ found = true ; break ; } } } if ( ! $ found ) { return false ; } if ( isset ( $ info [ 'exclude' ] ) ) { if ( ! isset ( $ info [ 'exclude' ] [ 0 ] ) ) { $ info [ 'exclude' ] = array ( $ info [ 'exclude' ] ) ; } foreach ( $ info [ 'exclude' ] as $ exclude ) { if ( version_compare ( $ me , $ exclude , '==' ) ) { return false ; } } } if ( version_compare ( $ me , $ info [ 'min' ] , '>=' ) && version_compare ( $ me , $ info [ 'max' ] , '<=' ) ) { return true ; } return false ; }
Determines whether this package claims it is compatible with the version of
the package that has a recommended version dependency
@param PEAR_PackageFile_v2|PEAR_PackageFile_v1|PEAR_Downloader_Package
@return boolean
Determines whether this package claims it is compatible with the version of the package that has a recommended version dependency