system/src/Grav/Common/GPM/GPM.php
/**
     * Check the package identified by $slug can be updated to the version passed as argument.
     * Thrown an exception if it cannot be updated because another package installed requires it to be at an older version.
     *
     * @param string $slug
     * @param string $version_with_operator
     * @param array $ignore_packages_list
     *
     * @return bool
     * @throws \Exception
     */
Check the package identified by $slug can be updated to the version passed as argument.
Thrown an exception if it cannot be updated because another package installed requires it to be at an older version.



@return bool
@throws \Exception
Check the package identified by $slug can be updated to the version passed as argument . Thrown an exception if it cannot be updated because another package installed requires it to be at an older version . @return bool @throws \ Exception
public function checkNoOtherPackageNeedsThisDependencyInALowerVersion(
        $slug,
        $version_with_operator,
        $ignore_packages_list
    ) {
        $dependent_packages = $this->getPackagesThatDependOnPackage($slug);
        $version = $this->calculateVersionNumberFromDependencyVersion($version_with_operator);
        if (count($dependent_packages)) {
            foreach ($dependent_packages as $dependent_package) {
                $other_dependency_version_with_operator = $this->getVersionOfDependencyRequiredByPackage($dependent_package,
                    $slug);
                $other_dependency_version = $this->calculateVersionNumberFromDependencyVersion($other_dependency_version_with_operator);
                if ($this->versionFormatIsNextSignificantRelease($other_dependency_version_with_operator)) {
                    $compatible = $this->checkNextSignificantReleasesAreCompatible($version,
                        $other_dependency_version);
                    if (!$compatible) {
                        if (!in_array($dependent_package, $ignore_packages_list)) {
                            throw new \Exception("Package <cyan>$slug</cyan> is required in an older version by package <cyan>$dependent_package</cyan>. This package needs a newer version, and because of this it cannot be installed. The <cyan>$dependent_package</cyan> package must be updated to use a newer release of <cyan>$slug</cyan>.",
                                2);
                        }
                    }
                }
            }
        }
        return true;
    }
public function checkNoOtherPackageNeedsThisDependencyInALowerVersion ( $ slug , $ version_with_operator , $ ignore_packages_list ) { $ dependent_packages = $ this -> getPackagesThatDependOnPackage ( $ slug ) ; $ version = $ this -> calculateVersionNumberFromDependencyVersion ( $ version_with_operator ) ; if ( count ( $ dependent_packages ) ) { foreach ( $ dependent_packages as $ dependent_package ) { $ other_dependency_version_with_operator = $ this -> getVersionOfDependencyRequiredByPackage ( $ dependent_package , $ slug ) ; $ other_dependency_version = $ this -> calculateVersionNumberFromDependencyVersion ( $ other_dependency_version_with_operator ) ; if ( $ this -> versionFormatIsNextSignificantRelease ( $ other_dependency_version_with_operator ) ) { $ compatible = $ this -> checkNextSignificantReleasesAreCompatible ( $ version , $ other_dependency_version ) ; if ( ! $ compatible ) { if ( ! in_array ( $ dependent_package , $ ignore_packages_list ) ) { throw new \ Exception ( " Package <cyan> $ slug </cyan> is required in an older version by package <cyan> $ dependent_package </cyan>. This package needs a newer version, and because of this it cannot be installed. The <cyan> $ dependent_package </cyan> package must be updated to use a newer release of <cyan> $ slug </cyan>. " , 2 ) ; } } } } } return true ; }
Check the package identified by $slug can be updated to the version passed as argument.
Check the package identified by $slug can be updated to the version passed as argument .
// check if any of the currently installed package need this in a lower version than the one we need. In case, abort and tell which package // check version is compatible with the one needed by the current package