aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba/dba_driver.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
committerfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
commit6679734135fb04f4a7beccb81663bf1e9574f062 (patch)
tree887488543d98b5dd297d917718bdd99844e83ba5 /include/dba/dba_driver.php
parent08b757a22cd2804bfec8ecf682b6987b8c06ca49 (diff)
parentc696860cc53bc25558d83de5eda65d9b583da382 (diff)
downloadvolse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.gz
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.bz2
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.zip
Merge branch 'master' into tres
Conflicts: include/Contact.php include/ItemObject.php include/api.php include/attach.php include/diaspora.php include/dir_fns.php include/enotify.php include/event.php include/expire.php include/items.php include/notifier.php include/notify.php include/photos.php include/taxonomy.php include/text.php include/widgets.php include/zot.php mod/admin.php mod/channel.php mod/dirsearch.php mod/display.php mod/editwebpage.php mod/events.php mod/home.php mod/item.php mod/manage.php mod/mood.php mod/network.php mod/page.php mod/photos.php mod/ping.php mod/post.php mod/thing.php mod/viewsrc.php view/css/mod_events.css
Diffstat (limited to 'include/dba/dba_driver.php')
-rwxr-xr-xinclude/dba/dba_driver.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index 4a0f5e37b..708d8e709 100755
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -24,7 +24,6 @@
function dba_factory($server, $port,$user,$pass,$db,$dbtype,$install = false) {
$dba = null;
-
$dbtype = intval($dbtype);
if($dbtype == DBTYPE_POSTGRES) {
@@ -59,7 +58,7 @@ abstract class dba_driver {
const INSTALL_SCRIPT='install/schema_mysql.sql';
const NULL_DATE = '0000-00-00 00:00:00';
const UTC_NOW = 'UTC_TIMESTAMP()';
-
+
protected $debug = 0;
protected $db;
public $connected = false;
@@ -121,11 +120,11 @@ abstract class dba_driver {
function get_null_date() {
return static::NULL_DATE;
}
-
+
function get_install_script() {
return static::INSTALL_SCRIPT;
}
-
+
function utcnow() {
return static::UTC_NOW;
}
@@ -145,6 +144,7 @@ abstract class dba_driver {
return false;
}
}
+
return true;
}
@@ -166,19 +166,19 @@ abstract class dba_driver {
function quote_interval($txt) {
return $txt;
}
-
+
function optimize_table($table) {
q('OPTIMIZE TABLE '.$table);
}
-
+
function concat($fld, $sep) {
return 'GROUP_CONCAT(DISTINCT '.$fld.' SEPARATOR \''.$sep.'\')';
}
-
+
function escapebin($str) {
return $this->escape($str);
}
-
+
function unescapebin($str) {
return $str;
}
@@ -193,6 +193,7 @@ function printable($s) {
$s = str_replace("\x00",'.',$s);
if(x($_SERVER,'SERVER_NAME'))
$s = escape_tags($s);
+
return $s;
}
@@ -252,7 +253,7 @@ function db_quoteinterval($txt) {
function dbesc_identifier($str) {
global $db;
- return $db->escape_identifier($txt);
+ return $db->escape_identifier($str);
}
function db_utcnow() {
@@ -349,6 +350,7 @@ function dbesc_array_cb(&$item, $key) {
$item = '0001-01-01 00:00:00';
else if($item == '0001-01-01 00:00:00' && ACTIVE_DBTYPE == DBTYPE_MYSQL)
$item = '0000-00-00 00:00:00';
+
$item = dbesc($item);
}
}
@@ -382,8 +384,7 @@ function db_getfunc($f) {
$f = strtolower($f);
if(isset($lookup[$f]) && isset($lookup[$f][ACTIVE_DBTYPE]))
return $lookup[$f][ACTIVE_DBTYPE];
-
+
logger('Unable to abstract DB function "'. $f . '" for dbtype ' . ACTIVE_DBTYPE, LOGGER_DEBUG);
return $f;
}
-