aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba
diff options
context:
space:
mode:
Diffstat (limited to 'include/dba')
-rwxr-xr-xinclude/dba/dba_driver.php8
-rwxr-xr-xinclude/dba/dba_pdo.php14
2 files changed, 12 insertions, 10 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index e47f97387..ad1d9d194 100755
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -15,7 +15,7 @@ class DBA {
static public $scheme = 'mysql';
static public $logging = false;
- static public $install_script = 'install/schema_mysql.sql';
+ static public $install_script = 'schema_mysql.sql';
static public $null_date = '0001-01-01 00:00:00';
static public $utc_now = 'UTC_TIMESTAMP()';
static public $tquot = "`";
@@ -46,7 +46,7 @@ class DBA {
if(!($port))
$port = 5432;
- self::$install_script = 'install/schema_postgres.sql';
+ self::$install_script = 'schema_postgres.sql';
self::$utc_now = "now() at time zone 'UTC'";
self::$tquot = '"';
self::$scheme = 'pgsql';
@@ -163,7 +163,9 @@ abstract class dba_driver {
}
function get_install_script() {
- return \DBA::$install_script;
+ if(file_exists('install/' . PLATFORM_NAME . '/' . \DBA::$install_script))
+ return 'install/' . PLATFORM_NAME . '/' . \DBA::$install_script;
+ return 'install/' . \DBA::$install_script;
}
function get_table_quote() {
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index f76e6cdd7..f119d8926 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -74,19 +74,19 @@ class dba_pdo extends dba_driver {
return $result;
}
- if($this->debug) {
- db_logger('dba_pdo: DEBUG: ' . printable($sql) . ' returned ' . count($result) . ' results.', LOGGER_NORMAL, LOG_INFO);
- }
-
$r = array();
if($result) {
foreach($result as $x) {
$r[] = $x;
}
- if($this->debug) {
- db_logger('dba_pdo: ' . printable(print_r($r,true)), LOGGER_NORMAL, LOG_INFO);
- }
}
+
+ if($this->debug) {
+ db_logger('dba_pdo: DEBUG: ' . printable($sql) . ' returned ' . count($r) . ' results.', LOGGER_NORMAL, LOG_INFO);
+ db_logger('dba_pdo: ' . printable(print_r($r,true)), LOGGER_NORMAL, LOG_INFO);
+ }
+
+
return (($this->error) ? false : $r);
}