aboutsummaryrefslogtreecommitdiff
path: root/lib/minz/dao/Model_pdo.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/minz/dao/Model_pdo.php')
-rwxr-xr-xlib/minz/dao/Model_pdo.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/minz/dao/Model_pdo.php b/lib/minz/dao/Model_pdo.php
index 48c81d082..a93291fc8 100755
--- a/lib/minz/dao/Model_pdo.php
+++ b/lib/minz/dao/Model_pdo.php
@@ -80,6 +80,16 @@ class Model_pdo {
public function rollBack() {
$this->bd->rollBack();
}
+
+ public function size() {
+ $db = Configuration::dataBase ();
+ $sql = 'SELECT SUM(data_length + index_length) FROM information_schema.TABLES WHERE table_schema = ?';
+ $stm = $this->bd->prepare ($sql);
+ $values = array ($db['base']);
+ $stm->execute ($values);
+ $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0);
+ return $res[0];
+ }
}
class FreshPDO extends PDO {