Skip to content

Commit f294617

Browse files
committed
feat(gpm): send PHP version with index requests
Lets the GPM server return PHP-aware compat fallbacks: when a plugin's latest release requires a newer PHP than the client can run, the server now substitutes the most recent compatible older release instead of serving an uninstallable latest.
1 parent 7f71c07 commit f294617

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

system/src/Grav/Common/GPM/Remote/AbstractPackageCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct($repository = null, $refresh = false, $callback = nu
4949
$cache_dir = Grav::instance()['locator']->findResource('cache://gpm', true, true);
5050
$this->cache = new FilesystemCache($cache_dir);
5151

52-
$this->repository = $repository . '?v=' . GRAV_VERSION . '&' . $channel . '=1';
52+
$this->repository = $repository . '?v=' . GRAV_VERSION . '&php=' . PHP_VERSION . '&' . $channel . '=1';
5353
$this->raw = $this->cache->fetch(md5($this->repository));
5454

5555
$this->fetch($refresh, $callback);

system/src/Grav/Common/GPM/Remote/GravCore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct($refresh = false, $callback = null)
4343
$channel = Grav::instance()['config']->get('system.gpm.releases', 'stable');
4444
$cache_dir = Grav::instance()['locator']->findResource('cache://gpm', true, true);
4545
$this->cache = new FilesystemCache($cache_dir);
46-
$this->repository .= '?v=' . GRAV_VERSION . '&' . $channel . '=1';
46+
$this->repository .= '?v=' . GRAV_VERSION . '&php=' . PHP_VERSION . '&' . $channel . '=1';
4747
$this->raw = $this->cache->fetch(md5($this->repository));
4848

4949
$this->fetch($refresh, $callback);

0 commit comments

Comments
 (0)