stany.ferer 1 anno fa
parent
commit
7da9467a33
2 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 9 0
      core/class/core.class.php
  2. 4 0
      core/views/pages/cms.parametres-general.php

+ 9 - 0
core/class/core.class.php

@@ -389,4 +389,13 @@ class core
             return round(($val / pow(1024, -$diff)), 2) . $type_wanted;
         return round(($val), 2) . $type_wanted;
     }
+
+    public static function getSizeDataBase(){
+        db::query("SELECT
+                    table_schema AS nameDB, 
+                    ROUND(SUM( data_length + index_length ) / 1024 / 1024, 2) AS moDB 
+                    FROM information_schema.TABLES
+                    WHERE TABLE_SCHEMA = '".DB_NAME."'");
+        return db::single();
+    }
 }

+ 4 - 0
core/views/pages/cms.parametres-general.php

@@ -13,6 +13,10 @@
 ?>
 
 <h4>Espaces disques</h4>
+<?php $infosDB = core::getSizeDataBase(); ?>
+<div>
+    <span class="badge" style="background-color:#28a745; width: 130px;"><?php echo $infosDB["moDB"] ?> Mo</span> <label> <?php echo $infosDB["nameDB"] ?> (Mysql)</label>
+</div>
 <div>
     <span class="badge" style="background-color:#28a745; width: 130px;"><?php echo core::convertBytes(disk_free_space(DOCUMENT_ROOT), "o", "Go") . " / " . core::convertBytes(disk_total_space(DOCUMENT_ROOT), "o", "Go") ?></span> <label> Espace ROOT</label>
 </div>