mirror of
https://github.com/getgrav/grav.git
synced 2026-05-09 00:37:13 +02:00
Recognize '2.0' in compatibility inference and CLI badges
Extends the 1.7/1.8 compatibility machinery to treat a grav >= 2.0 dependency as ['2.0']. SelfupgradeCommand's preflight already keys off the target package's major.minor, so upgrading 1.8 → 2.0 now correctly flags plugins that only declare 1.7 or 1.8 as blocking. - GPM/Local/Package::inferCompatibility(): grav >= 2.0 → ['2.0'] - Installer/Install::inferCompatibleVersions(): grav >= 2.0 → ['2.0'] - IndexCommand / InfoCommand / UpdateCommand: magenta '2.0' badge Ships as part of the final 1.8 beta so the installed base has a clean upgrade gate when users run `bin/gpm selfupgrade` against a Grav 2.0 release. The actual migration wizard is a 2.0-only deliverable and is NOT backported here.
This commit is contained in:
@@ -91,6 +91,10 @@ class Package extends BasePackage
|
||||
continue;
|
||||
}
|
||||
|
||||
if (version_compare($m[1], '2.0', '>=')) {
|
||||
return ['grav' => ['2.0'], 'api' => []];
|
||||
}
|
||||
|
||||
if (version_compare($m[1], '1.8', '>=')) {
|
||||
return ['grav' => ['1.8'], 'api' => []];
|
||||
}
|
||||
|
||||
@@ -260,6 +260,9 @@ class IndexCommand extends GpmCommand
|
||||
if (in_array('1.8', $compat['grav'], true)) {
|
||||
$badges[] = '<green>1.8</green>';
|
||||
}
|
||||
if (in_array('2.0', $compat['grav'], true)) {
|
||||
$badges[] = '<magenta>2.0</magenta>';
|
||||
}
|
||||
|
||||
return implode(' ', $badges);
|
||||
}
|
||||
|
||||
@@ -150,6 +150,9 @@ class InfoCommand extends GpmCommand
|
||||
if (in_array('1.8', $compat['grav'], true)) {
|
||||
$badges[] = '<green>1.8</green>';
|
||||
}
|
||||
if (in_array('2.0', $compat['grav'], true)) {
|
||||
$badges[] = '<magenta>2.0</magenta>';
|
||||
}
|
||||
$compatStr = implode(' ', $badges);
|
||||
} else {
|
||||
$compatStr = '<blue>1.7</blue>';
|
||||
|
||||
@@ -222,6 +222,9 @@ class UpdateCommand extends GpmCommand
|
||||
if (in_array('1.8', $compat['grav'], true)) {
|
||||
$badges[] = '<green>1.8</green>';
|
||||
}
|
||||
if (in_array('2.0', $compat['grav'], true)) {
|
||||
$badges[] = '<magenta>2.0</magenta>';
|
||||
}
|
||||
$compatStr = ' ' . implode(' ', $badges);
|
||||
}
|
||||
|
||||
|
||||
@@ -1448,6 +1448,10 @@ ERR;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (version_compare($m[1], '2.0', '>=')) {
|
||||
return ['grav' => ['2.0'], 'api' => []];
|
||||
}
|
||||
|
||||
if (version_compare($m[1], '1.8', '>=')) {
|
||||
return ['grav' => ['1.8'], 'api' => []];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user