diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-07 14:45:27 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-07 14:45:27 +0500 |
| commit | 2d06d465e80d9d115641f2ed1ff9ed294da0b38c (patch) | |
| tree | 08968bc9a7cd6ab7020d05f2b9ff19332488319a /public/index.php | |
| parent | 71937e5897c3dea1c418e4ebbd5ebd4c9f762b89 (diff) | |
feat: show active content size
Diffstat (limited to 'public/index.php')
| -rw-r--r-- | public/index.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/public/index.php b/public/index.php index ba0be34..c86dd46 100644 --- a/public/index.php +++ b/public/index.php @@ -47,10 +47,24 @@ authorize_user(); ?> </div> - <p style="font-size:12px;"> - Serving <?php echo $count ?> gorillion emotes - - Running + <p class="font-small"> <?php + // cv pasted from https://gist.github.com/eusonlito/5099936 + function size($dir) + { + $size = 0; + + foreach (glob(rtrim($dir, '/') . '/*') as $each) { + $size += is_file($each) ? filesize($each) : size($each); + } + + return $size; + } + + echo "Serving $count gorillion emotes and "; + + echo sprintf("%.2f", size("./static/userdata") / 1024 / 1024) . 'MB of active content - Running '; + echo '<a href="' . TINYEMOTES_LINK . '">'; echo sprintf("%s v%s", TINYEMOTES_NAME, TINYEMOTES_VERSION); echo '</a> '; |
