diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-07-01 09:52:54 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2024-07-02 13:06:34 +0200 |
| commit | 1eedc35734ef015c8f117d1dfe3f01cf3c4675e6 (patch) | |
| tree | fc79ecd12f728e440734567f00fc2e8e9da54eaf | |
| parent | 260387cb7662a6606d8aa6e78282082928d343c4 (diff) | |
fix StudipFileCache::getStats(), fixes #3699
Closes #3699
Merge request studip/studip!2568
| -rw-r--r-- | lib/classes/StudipFileCache.class.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/classes/StudipFileCache.class.php b/lib/classes/StudipFileCache.class.php index 9eae66c..2037b6e 100644 --- a/lib/classes/StudipFileCache.class.php +++ b/lib/classes/StudipFileCache.class.php @@ -240,11 +240,16 @@ class StudipFileCache implements StudipCache */ public function getStats(): array { + $count = 0; + foreach (@glob($this->dir . '*', GLOB_ONLYDIR) as $current_dir){ + $count += count(@glob("{$current_dir}/*")); + } + return [ __CLASS__ => [ 'name' => _('Anzahl Einträge'), - 'value' => DBManager::get()->fetchColumn("SELECT COUNT(*) FROM `cache`") - ] + 'value' => $count, + ], ]; } |
