mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-13 10:34:54 +01:00
support update jsons that cover multiple plugins
This commit is contained in:
parent
66f2a53591
commit
c09a52ee3c
@ -240,7 +240,14 @@ class Plugin extends Model implements HasPluginSettings
|
|||||||
|
|
||||||
return cache()->remember("plugins.$this->id.update", now()->addMinutes(10), function () {
|
return cache()->remember("plugins.$this->id.update", now()->addMinutes(10), function () {
|
||||||
try {
|
try {
|
||||||
return json_decode(file_get_contents($this->update_url), true, 512, JSON_THROW_ON_ERROR);
|
$data = json_decode(file_get_contents($this->update_url), true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
|
||||||
|
// Support update jsons that cover multiple plugins
|
||||||
|
if (array_key_exists($this->id, $data)) {
|
||||||
|
$data = $data[$this->id];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
report($exception);
|
report($exception);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user