aboutsummaryrefslogtreecommitdiff
path: root/app/Models/EntryDAOPGSQL.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-30 20:15:11 +0100
committerGravatar GitHub <noreply@github.com> 2016-10-30 20:15:11 +0100
commit1d3e5bdee069434fd65c2717ae8fcce8c54fe81d (patch)
tree39b0ae9ac0b0d1ed7fa11c747a0523cb3faa384b /app/Models/EntryDAOPGSQL.php
parent17c8c039df675b3b0f8d88d14f7316a240eabe76 (diff)
parent29e1f048159b7a580bdf1bab184e928f11d104b4 (diff)
Merge pull request #1346 from FreshRSS/dev1.6.0
Merge 1.6.0-dev in master
Diffstat (limited to 'app/Models/EntryDAOPGSQL.php')
-rw-r--r--app/Models/EntryDAOPGSQL.php31
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];
+ }
+
+}