mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-26 14:50:15 +02:00
Use configurable API URI for plugin updates
Replaces hardcoded plugin API URI with a configurable value from config, defaulting to the official API. Also fixes a typo in the success message.
This commit is contained in:
parent
1c6bb2eb8d
commit
7c49c16215
@ -53,14 +53,12 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isset($_GET['check-updates'])) {
|
else if (isset($_GET['check-updates'])) {
|
||||||
success('Fetching latest info from plugins.my-aac.org..');
|
$repoUri = $config['admin_plugins_api_uri'] ?? 'https://plugins.my-aac.org/api/';
|
||||||
|
success("Fetching latest info from $repoUri..");
|
||||||
|
|
||||||
$adminPlugins = new \MyAAC\Admin\Plugins();
|
$adminPlugins = new \MyAAC\Admin\Plugins();
|
||||||
|
|
||||||
// TODO: Maybe find a better way? Probably settings
|
$adminPlugins->setApiBaseUri($repoUri);
|
||||||
if (str_contains(BASE_URL, 'myaac.local')) {
|
|
||||||
$adminPlugins->setApiBaseUri('http://plugins.my-aac.local/api/');
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$plugins = $adminPlugins->getLatestVersions();
|
$plugins = $adminPlugins->getLatestVersions();
|
||||||
@ -100,7 +98,7 @@ else {
|
|||||||
$twig->display('admin.plugins.outdated.html.twig', ['plugins' => $outdated]);
|
$twig->display('admin.plugins.outdated.html.twig', ['plugins' => $outdated]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
success('All plugins up do date!');
|
success('All plugins up to date!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (isset($_FILES['plugin']['name'])) {
|
} else if (isset($_FILES['plugin']['name'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user