Check for newer pluginversions at startup
This commit is contained in:
parent
6e37411fc4
commit
c0b9263b97
@ -306,6 +306,7 @@ class ManiaControl implements CommandListener, TimerListener {
|
|||||||
|
|
||||||
// Load plugins
|
// Load plugins
|
||||||
$this->pluginManager->loadPlugins();
|
$this->pluginManager->loadPlugins();
|
||||||
|
$this->updateManager->checkPluginsUpdate();
|
||||||
|
|
||||||
// AfterInit callback
|
// AfterInit callback
|
||||||
$this->callbackManager->triggerCallback(CallbackManager::CB_AFTERINIT);
|
$this->callbackManager->triggerCallback(CallbackManager::CB_AFTERINIT);
|
||||||
|
@ -302,6 +302,17 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkPluginsUpdate() {
|
||||||
|
$this->maniaControl->log('[UPDATE] Checking plugins for newer versions ...');
|
||||||
|
foreach($this->maniaControl->pluginManager->getPluginClasses() as $pluginClass) {
|
||||||
|
$pluginData = $this->checkPluginUpdate($pluginClass);
|
||||||
|
if($pluginData != false) {
|
||||||
|
$this->maniaControl->log('[UPDATE] '.$pluginClass.': There is a newer version available: '.$pluginData->currentVersion->version.'!');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->maniaControl->log('[UPDATE] Checking plugins: COMPLETE!');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check given Plugin Class for Update
|
* Check given Plugin Class for Update
|
||||||
*
|
*
|
||||||
@ -322,7 +333,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
|
|||||||
}
|
}
|
||||||
$pluginData = $pluginVersions[0];
|
$pluginData = $pluginVersions[0];
|
||||||
$pluginVersion = $pluginClass::getVersion();
|
$pluginVersion = $pluginClass::getVersion();
|
||||||
if ($pluginData->version <= $pluginVersion) {
|
if ($pluginData->currentVersion->version <= $pluginVersion) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $pluginData;
|
return $pluginData;
|
||||||
|
Loading…
Reference in New Issue
Block a user