private function findUpgradeNotes($packageName, $fromVersion)
    {
        if (preg_match('/^([0-9]\.[0-9]+\.?[0-9]*)/', $fromVersion, $m)) {
            $fromVersionMajor = $m[1];
        } else {
            $fromVersionMajor = $fromVersion;
        }

        $upgradeFile = $this->_vendorDir . '/' . $packageName . '/UPGRADE.md';
        if (!is_file($upgradeFile) || !is_readable($upgradeFile)) {
            return false;
        }
        $lines = preg_split('~\R~', file_get_contents($upgradeFile));
        $relevantLines = [];
        $consuming = false;
        // whether an exact match on $fromVersion has been encountered
        $foundExactMatch = false;
        foreach($lines as $line) {
            if (preg_match('/^Upgrade from Yii ([0-9]\.[0-9]+\.?[0-9\.]*)/i', $line, $matches)) {
                if ($matches[1] === $fromVersion) {
                    $foundExactMatch = true;
                }
                if (version_compare($matches[1], $fromVersion, '<') && ($foundExactMatch || version_compare($matches[1], $fromVersionMajor, '<'))) {
                    break;
                }
                $consuming = true;
            }
            if ($consuming) {
                $relevantLines[] = $line;
            }
        }
        return $relevantLines;
    }
private function findUpgradeNotes($packageName, $fromVersion)
    {
        if (preg_match('/^([0-9]\.[0-9]+\.?[0-9]*)/', $fromVersion, $m)) {
            $fromVersionMajor = $m[1];
        } else {
            $fromVersionMajor = $fromVersion;
        }

        $upgradeFile = $this->_vendorDir . '/' . $packageName . '/UPGRADE.md';
        if (!is_file($upgradeFile) || !is_readable($upgradeFile)) {
            return false;
        }
        $lines = preg_split('~\R~', file_get_contents($upgradeFile));
        $relevantLines = [];
        $consuming = false;
        // whether an exact match on $fromVersion has been encountered
        $foundExactMatch = false;
        foreach($lines as $line) {
            if (preg_match('/^Upgrade from Yii ([0-9]\.[0-9]+\.?[0-9\.]*)/i', $line, $matches)) {
                if ($matches[1] === $fromVersion) {
                    $foundExactMatch = true;
                }
                if (version_compare($matches[1], $fromVersion, '<') && ($foundExactMatch || version_compare($matches[1], $fromVersionMajor, '<'))) {
                    break;
                }
                $consuming = true;
            }
            if ($consuming) {
                $relevantLines[] = $line;
            }
        }
        return $relevantLines;
    }
private function findUpgradeNotes ( $ packageName , $ fromVersion ) { if ( preg_match ( '/^([0-9]\.[0-9]+\.?[0-9]*)/' , $ fromVersion , $ m ) ) { $ fromVersionMajor = $ m [ 1 ] ; } else { $ fromVersionMajor = $ fromVersion ; } $ upgradeFile = $ this -> _vendorDir . '/' . $ packageName . '/UPGRADE.md' ; if ( ! is_file ( $ upgradeFile ) || ! is_readable ( $ upgradeFile ) ) { return false ; } $ lines = preg_split ( '~\R~' , file_get_contents ( $ upgradeFile ) ) ; $ relevantLines = [ ] ; $ consuming = false ; // whether an exact match on $fromVersion has been encountered $ foundExactMatch = false ; foreach ( $ lines as $ line ) { if ( preg_match ( '/^Upgrade from Yii ([0-9]\.[0-9]+\.?[0-9\.]*)/i' , $ line , $ matches ) ) { if ( $ matches [ 1 ] === $ fromVersion ) { $ foundExactMatch = true ; } if ( version_compare ( $ matches [ 1 ] , $ fromVersion , '<' ) && ( $ foundExactMatch || version_compare ( $ matches [ 1 ] , $ fromVersionMajor , '<' ) ) ) { break ; } $ consuming = true ; } if ( $ consuming ) { $ relevantLines [ ] = $ line ; } } return $ relevantLines ; }
Read upgrade notes from a files and returns an array of lines
@param string $packageName
@param string $fromVersion until which version to read the notes
@return array|false
Read upgrade notes from a files and returns an array of lines