本文整理匯總了PHP中Version::isUpgrade方法的典型用法代碼示例。如果您正苦於以下問題:PHP Version::isUpgrade方法的具體用法?PHP Version::isUpgrade怎麽用?PHP Version::isUpgrade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Version
的用法示例。
在下文中一共展示了Version::isUpgrade方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getNewVersions
/**
* Get all of the new versions available for a given package
*
* Unlike getAvailableUpgrades(), this gets the full dataset
*
* @param array $package
* @return array
*/
protected function getNewVersions(array $package) : array
{
$current = $this->db->cell('SELECT versionid FROM airship_package_versions WHERE package = ? AND version = ?', $package['packageid'], $package['current_version']);
if (!$current) {
$current = 0;
}
$available = $this->db->run('SELECT * FROM airship_package_versions WHERE package = ? AND versionid > ?', $package['packageid'], $current);
$version = new Version($package['current_version'] ?? '0.0.0');
$results = [];
foreach ($available as $ver) {
if ($version->isUpgrade($ver['version'])) {
$results[] = $ver;
}
}
return $results;
}