diff options
| author | 2017-02-15 14:14:03 +0100 | |
|---|---|---|
| committer | 2017-02-15 14:14:03 +0100 | |
| commit | 5a1bb1393b4496eb35a2ffb3cc63d41c9dc1e2e5 (patch) | |
| tree | 67028e45792c575c25c92616633f64cc7a4a13eb /app/Models/EntryDAOPGSQL.php | |
| parent | 7e949d50320317b5c3b5a2da2bdaf324e794b2f7 (diff) | |
| parent | 5f637bd816b7323885bfe1751a1724ee59a822f6 (diff) | |
Merge remote-tracking branch 'FreshRSS/master'
Diffstat (limited to 'app/Models/EntryDAOPGSQL.php')
| -rw-r--r-- | app/Models/EntryDAOPGSQL.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php new file mode 100644 index 000000000..b96a62ebc --- /dev/null +++ b/app/Models/EntryDAOPGSQL.php @@ -0,0 +1,31 @@ +<?php + +class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite { + + public function sqlHexDecode($x) { + return 'decode(' . $x . ", 'hex')"; + } + + public function sqlHexEncode($x) { + return 'encode(' . $x . ", 'hex')"; + } + + protected function autoUpdateDb($errorInfo) { + return false; + } + + protected function addColumn($name) { + return false; + } + + public function size($all = true) { + $db = FreshRSS_Context::$system_conf->db; + $sql = 'SELECT pg_size_pretty(pg_database_size(?))'; + $values = array($db['base']); + $stm = $this->bd->prepare($sql); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + return $res[0]; + } + +} |
