aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-10-20 15:45:48 -0700
committerzotlabs <mike@macgirvin.com>2016-10-20 15:45:48 -0700
commitb4b5eb5babcfd01f41e3df39400758422b39d591 (patch)
treeb5fb795d86f39cb246b1279910eb2ed814f2deba
parent3726b546d5e24b2f8ffa3d02346c7a0905d3ca65 (diff)
downloadvolse-hubzilla-b4b5eb5babcfd01f41e3df39400758422b39d591.tar.gz
volse-hubzilla-b4b5eb5babcfd01f41e3df39400758422b39d591.tar.bz2
volse-hubzilla-b4b5eb5babcfd01f41e3df39400758422b39d591.zip
pdo testing
-rwxr-xr-xinclude/dba/dba_driver.php9
-rwxr-xr-xinclude/dba/dba_pdo.php15
2 files changed, 17 insertions, 7 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index 47ec29816..abbacc56e 100755
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -51,20 +51,21 @@ class DBA {
self::$install_script = 'install/schema_postgres.sql';
self::$utc_now = "now() at time zone 'UTC'";
self::$tquot = '"';
- self::$scheme = 'postgres';
+ self::$scheme = 'pgsql';
- require_once('include/dba/dba_postgres.php');
- self::$dba = new dba_postgres($server, self::$scheme, $port, $user, $pass, $db, $install);
+// require_once('include/dba/dba_postgres.php');
+// self::$dba = new dba_postgres($server, self::$scheme, $port, $user, $pass, $db, $install);
}
else {
if(!($port))
$port = 3306;
if($server === 'localhost')
$server = '127.0.0.1';
+ }
require_once('include/dba/dba_pdo.php');
self::$dba = new dba_pdo($server,self::$scheme,$port,$user,$pass,$db,$install);
- }
+
if(is_object(self::$dba) && self::$dba->connected) {
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index 44de60d58..b3a1209bc 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -28,7 +28,7 @@ class dba_pdo extends dba_driver {
return false;
}
- if($this->driver_dbtype === 'postgres')
+ if($this->driver_dbtype === 'pgsql')
$this->q("SET standard_conforming_strings = 'off'; SET backslash_quote = 'on';");
$this->connected = true;
@@ -40,7 +40,7 @@ class dba_pdo extends dba_driver {
if((! $this->db) || (! $this->connected))
return false;
- if($this->driver_dbtype === 'postgres' && (! strpos($sql,';')))
+ if($this->driver_dbtype === 'pgsql' && (! strpos($sql,';')))
$sql .= ';';
$this->error = '';
@@ -96,7 +96,7 @@ class dba_pdo extends dba_driver {
}
function concat($fld,$sep) {
- if($this->driver_dbtype === 'postgres') {
+ if($this->driver_dbtype === 'pgsql') {
return 'string_agg(' . $fld . ',\'' . $sep . '\')';
}
else {
@@ -104,6 +104,15 @@ class dba_pdo extends dba_driver {
}
}
+ function quote_interval($txt) {
+ if($this->driver_dbtype === 'pgsql') {
+ return "'$txt'";
+ }
+ else {
+ return $txt;
+ }
+ }
+
function getdriver() {
return 'pdo';