Add self test check: "Mobile App - Push Service" (#6628)

* Add self test check: "Mobile App - Push Service"

* Fix wording
This commit is contained in:
Yuriy Bakhtin 2023-10-24 21:39:14 +02:00 committed by GitHub
parent 502b17791e
commit 7d19bf7a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 32 deletions

View File

@ -7,6 +7,7 @@ HumHub Changelog
- Enh #6620: Marketplace: Add more module checks
- Enh #6621: Avoid PHP error when trying to download a file without guid in the URL params (return 404 exception instead)
- Enh #6623: Add a hint in the "Dropdown space order" settings to inform that a manual sort is always applied first
- Enh #6628: Add self test check: "Mobile App - Push Service"
1.15.0-beta.2 (October 5, 2023)
-------------------------------

View File

@ -316,22 +316,6 @@ class SelfTest
];
}
// Checks GraphicsMagick Extension
$title = 'PHP - ' . Yii::t('AdminModule.information', '{phpExtension} Extension', ['phpExtension' => 'GraphicsMagick']);
if (class_exists('Gmagick', false)) {
$checks[] = [
'title' => $title,
'state' => 'OK'
];
} else {
$checks[] = [
'title' => $title,
'state' => 'WARNING',
'hint' => Yii::t('AdminModule.information', 'Optional')
];
}
$memoryLimit = ini_get('memory_limit');
if (preg_match('/^(\d+)(.)$/', $memoryLimit, $m)) {
if ($m[2] == 'G') {
@ -393,22 +377,6 @@ class SelfTest
];
}
// Checks SQLite3 Extension
$title = 'PHP - ' . Yii::t('AdminModule.information', '{phpExtension} Support', ['phpExtension' => 'SQLite3']);
if (class_exists('SQLite3')) {
$checks[] = [
'title' => $title,
'state' => 'OK'
];
} else {
$checks[] = [
'title' => $title,
'state' => 'WARNING',
'hint' => Yii::t('AdminModule.information', 'Optional') . ' - '
. Yii::t('AdminModule.information', 'Install {phpExtension} Extension for DB Caching', ['phpExtension' => 'SQLite3'])
];
}
// Checks PDO MySQL Extension
$title = 'PHP - ' . Yii::t('AdminModule.information', '{phpExtension} Extension', ['phpExtension' => 'PDO MySQL']);
if (extension_loaded('pdo_mysql')) {
@ -876,6 +844,25 @@ class SelfTest
];
}
// Check Mobile App - Push Service
$title = $titlePrefix . Yii::t('AdminModule.information', 'Mobile App - Push Service');
/* @var \humhub\modules\fcmPush\Module|null $pushModule */
$pushModule = $modules['fcm-push'] ?? null;
if ($pushModule instanceof \humhub\modules\fcmPush\Module &&
$pushModule->isActivated &&
$pushModule->getGoService()->isConfigured()) {
$checks[] = [
'title' => $title,
'state' => 'OK'
];
} else {
$checks[] = [
'title' => $title,
'state' => 'WARNING',
'hint' => Yii::t('AdminModule.information', '"Push Notifications (Firebase)" module and setup of Firebase API Key required')
];
}
return $checks;
}
}