summaryrefslogtreecommitdiffstats
path: root/lib/db
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-08-07 18:16:34 +0200
committerBart Visscher <bartv@thisnet.nl>2013-08-07 18:17:37 +0200
commit2cc94cbc7387a7cd15803c8e3b4d450f05e7b041 (patch)
treec8058387d44fe008440beb61ebb43a8acac23171 /lib/db
parent95a959b10b7c9dc7b0529fbb7b05c11685f19e8b (diff)
downloadnextcloud-server-2cc94cbc7387a7cd15803c8e3b4d450f05e7b041.tar.gz
nextcloud-server-2cc94cbc7387a7cd15803c8e3b4d450f05e7b041.zip
Style fixes
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/adapteroci8.php3
-rw-r--r--lib/db/adapterpgsql.php3
-rw-r--r--lib/db/statementwrapper.php4
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/db/adapteroci8.php b/lib/db/adapteroci8.php
index 3ff98af04fe..bc226e979ec 100644
--- a/lib/db/adapteroci8.php
+++ b/lib/db/adapteroci8.php
@@ -18,10 +18,11 @@ class AdapterOCI8 extends Adapter {
return $this->conn->realLastInsertId($table);
}
+ const UNIX_TIMESTAMP_REPLACEMENT = "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400";
public function fixupStatement($statement) {
$statement = str_replace( '`', '"', $statement );
$statement = str_ireplace( 'NOW()', 'CURRENT_TIMESTAMP', $statement );
- $statement = str_ireplace( 'UNIX_TIMESTAMP()', "(cast(sys_extract_utc(systimestamp) as date) - date'1970-01-01') * 86400", $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
return $statement;
}
}
diff --git a/lib/db/adapterpgsql.php b/lib/db/adapterpgsql.php
index acfc4201629..990d71c9f29 100644
--- a/lib/db/adapterpgsql.php
+++ b/lib/db/adapterpgsql.php
@@ -14,9 +14,10 @@ class AdapterPgSql extends Adapter {
return $this->conn->fetchColumn('SELECT lastval()');
}
+ const UNIX_TIMESTAMP_REPLACEMENT = 'cast(extract(epoch from current_timestamp) as integer)';
public function fixupStatement($statement) {
$statement = str_replace( '`', '"', $statement );
- $statement = str_ireplace( 'UNIX_TIMESTAMP()', 'cast(extract(epoch from current_timestamp) as integer)', $statement );
+ $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
return $statement;
}
}
diff --git a/lib/db/statementwrapper.php b/lib/db/statementwrapper.php
index f7bc45e068f..b8da1afc0e5 100644
--- a/lib/db/statementwrapper.php
+++ b/lib/db/statementwrapper.php
@@ -53,7 +53,7 @@ class OC_DB_StatementWrapper {
*/
public function execute($input=array()) {
if(OC_Config::getValue( "log_query", false)) {
- $params_str = str_replace("\n"," ",var_export($input,true));
+ $params_str = str_replace("\n", " ", var_export($input, true));
OC_Log::write('core', 'DB execute with arguments : '.$params_str, OC_Log::DEBUG);
}
$this->lastArguments = $input;
@@ -134,7 +134,7 @@ class OC_DB_StatementWrapper {
$host = OC_Config::getValue( "dbhost", "" );
$user = OC_Config::getValue( "dbuser", "" );
$pass = OC_Config::getValue( "dbpassword", "" );
- if (strpos($host,':')) {
+ if (strpos($host, ':')) {
list($host, $port) = explode(':', $host, 2);
} else {
$port = false;