mirror of
https://github.com/humhub/humhub.git
synced 2025-03-11 02:31:03 +01:00
Enh #5100: Added SelfTest for HumHub API connectivity
This commit is contained in:
parent
02db2d5af8
commit
491770b35c
@ -15,3 +15,4 @@ HumHub Changelog
|
||||
- Fix #5903: ContentContainerModule::getEnabledContentContainers() returns an empty array
|
||||
- Enh #5908: New filter ActiveQueryUser->available()
|
||||
- Enh #5785: Adding option for custom .well-known routes
|
||||
- Enh #5100: Added SelfTest for HumHub API connectivity
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\libs;
|
||||
|
||||
use humhub\modules\admin\libs\HumHubAPI;
|
||||
use humhub\modules\ldap\helpers\LdapHelper;
|
||||
use humhub\modules\marketplace\Module;
|
||||
use Yii;
|
||||
@ -541,7 +542,7 @@ class SelfTest
|
||||
'hint' => Yii::t('AdminModule.information', 'Make {filePath} writable for the Webserver/PHP!', ['filePath' => $path])
|
||||
];
|
||||
}
|
||||
// Check Custom Modules Directory
|
||||
// Check Dynamic Config is Writable
|
||||
$title = Yii::t('AdminModule.information', 'Permissions') . ' - ' . Yii::t('AdminModule.information', 'Dynamic Config');
|
||||
$path = Yii::getAlias(Yii::$app->params['dynamicConfigFile']);
|
||||
if (!is_file($path)) {
|
||||
@ -561,6 +562,20 @@ class SelfTest
|
||||
];
|
||||
}
|
||||
|
||||
// Check HumHub Marketplace API Connection
|
||||
$title = Yii::t('AdminModule.information', 'HumHub') . ' - ' . Yii::t('AdminModule.information', 'Marketplace API Connection');
|
||||
if (empty(HumHubAPI::getLatestHumHubVersion(false))) {
|
||||
$checks[] = [
|
||||
'title' => $title,
|
||||
'state' => 'WARNING'
|
||||
];
|
||||
} else {
|
||||
$checks[] = [
|
||||
'title' => $title,
|
||||
'state' => 'OK'
|
||||
];
|
||||
}
|
||||
|
||||
return $checks;
|
||||
}
|
||||
|
||||
|
@ -51,10 +51,10 @@ class HumHubAPI
|
||||
*
|
||||
* @return string latest HumHub Version
|
||||
*/
|
||||
public static function getLatestHumHubVersion()
|
||||
public static function getLatestHumHubVersion($useCache = true)
|
||||
{
|
||||
$latestVersion = Yii::$app->cache->get('latestVersion');
|
||||
if ($latestVersion === false) {
|
||||
if (!$useCache || $latestVersion === false) {
|
||||
$info = self::request('v1/modules/getLatestVersion');
|
||||
|
||||
if (isset($info['latestVersion'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user