mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 03:27:08 +02:00
Let GPM read and pass the current channel to Grav's repository
This commit is contained in:
@@ -41,10 +41,11 @@ class AbstractPackageCollection extends BaseCollection
|
||||
throw new \RuntimeException("A repository is required to indicate the origin of the remote collection");
|
||||
}
|
||||
|
||||
$channel = Grav::instance()['config']->get('system.gpm.releases', 'stable');
|
||||
$cache_dir = Grav::instance()['locator']->findResource('cache://gpm', true, true);
|
||||
$this->cache = new FilesystemCache($cache_dir);
|
||||
|
||||
$this->repository = $repository . '?v=' . GRAV_VERSION;
|
||||
$this->repository = $repository . '?v=' . GRAV_VERSION . '&' . $channel . '=1';
|
||||
$this->raw = $this->cache->fetch(md5($this->repository));
|
||||
|
||||
$this->fetch($refresh, $callback);
|
||||
|
||||
@@ -18,9 +18,10 @@ class GravCore extends AbstractPackageCollection
|
||||
*/
|
||||
public function __construct($refresh = false, $callback = null)
|
||||
{
|
||||
$channel = Grav::instance()['config']->get('system.gpm.releases', 'stable');
|
||||
$cache_dir = Grav::instance()['locator']->findResource('cache://gpm', true, true);
|
||||
$this->cache = new FilesystemCache($cache_dir);
|
||||
$this->repository .= '?v=' . GRAV_VERSION;
|
||||
$this->repository .= '?v=' . GRAV_VERSION . '&' . $channel . '=1';
|
||||
$this->raw = $this->cache->fetch(md5($this->repository));
|
||||
|
||||
$this->fetch($refresh, $callback);
|
||||
|
||||
@@ -21,8 +21,6 @@ class Plugins extends AbstractPackageCollection
|
||||
*/
|
||||
public function __construct($refresh = false, $callback = null)
|
||||
{
|
||||
$this->repository .= '?v=' . GRAV_VERSION;
|
||||
|
||||
parent::__construct($this->repository, $refresh, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,6 @@ class Themes extends AbstractPackageCollection
|
||||
*/
|
||||
public function __construct($refresh = false, $callback = null)
|
||||
{
|
||||
$this->repository .= '?v=' . GRAV_VERSION;
|
||||
|
||||
parent::__construct($this->repository, $refresh, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user