Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/serverinfo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrik Kernstock <info@pkern.at>2017-06-14 04:26:12 +0300
committerPatrik Kernstock <info@pkern.at>2017-06-14 04:26:12 +0300
commit3d85e156b05edee3aac1c5b9d585a3823fbc0ab9 (patch)
tree79d8cc9ed1dd082409aec45509fd538cd6821fd9 /lib/SystemStatistics.php
parent8714f21303ea5cd3cb14f44152f4579958e77c88 (diff)
Add enabled apps for monitoring endpoint as well
Signed-off-by: Patrik Kernstock <info@pkern.at>
Diffstat (limited to 'lib/SystemStatistics.php')
-rw-r--r--lib/SystemStatistics.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/SystemStatistics.php b/lib/SystemStatistics.php
index 5d31c19..0d421d1 100644
--- a/lib/SystemStatistics.php
+++ b/lib/SystemStatistics.php
@@ -24,6 +24,7 @@ namespace OCA\ServerInfo;
use OC\Files\View;
use OCP\IConfig;
+use \OC_App;
use OC\App\AppStore\Fetcher\AppFetcher;
class SystemStatistics {
@@ -119,16 +120,20 @@ class SystemStatistics {
// sekeleton about the data we return back
$info = [
'num_installed' => 0,
+ 'num_enabled' => 0,
'num_updates_available' => 0,
'app_updates' => [],
];
// load all apps
- $appClass = new \OC_App();
- $apps = $appClass->listAllApps();
- // check each app
+ $apps = (new OC_App())->listAllApps();
foreach($apps as $key => $app) {
+ // count installed apps
$info['num_installed']++;
+ // count activated apps
+ if ($app['active']) {
+ $info['num_enabled']++;
+ }
// check if there is any new version available for that specific app
$newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher);