X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fdba.php;h=3a16c187c7ec81b47085d894d169c047e18b7cd6;hb=3e299aa7bf42f1645fddeb426ff9b7140fdbc492;hp=7409ec3a8ce69e278e9ac0c205dc7890b5e9657e;hpb=dfa52185cac97b86225f20b2e73839de03a54e22;p=friendica.git diff --git a/include/dba.php b/include/dba.php index 7409ec3a8c..3a16c187c7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -1,25 +1,29 @@ 0); + } + function __destruct() { - if ($this->db) + if ($this->db) if($this->mysqli) $this->db->close(); else @@ -245,14 +259,14 @@ function printable($s) { }} // Procedural functions -if(! function_exists('dbg')) { +if(! function_exists('dbg')) { function dbg($state) { global $db; if($db) $db->dbg($state); }} -if(! function_exists('dbesc')) { +if(! function_exists('dbesc')) { function dbesc($str) { global $db; if($db && $db->connected) @@ -268,7 +282,7 @@ function dbesc($str) { // Example: $r = q("SELECT * FROM `%s` WHERE `uid` = %d", // 'user', 1); -if(! function_exists('q')) { +if(! function_exists('q')) { function q($sql) { global $db; @@ -285,12 +299,12 @@ function q($sql) { /** * - * This will happen occasionally trying to store the - * session data after abnormal program termination + * This will happen occasionally trying to store the + * session data after abnormal program termination * */ logger('dba: no database: ' . print_r($args,true)); - return false; + return false; }} @@ -300,7 +314,7 @@ function q($sql) { * */ -if(! function_exists('dbq')) { +if(! function_exists('dbq')) { function dbq($sql) { global $db; @@ -312,10 +326,10 @@ function dbq($sql) { }} -// Caller is responsible for ensuring that any integer arguments to +// Caller is responsible for ensuring that any integer arguments to // dbesc_array are actually integers and not malformed strings containing -// SQL injection vectors. All integer array elements should be specifically -// cast to int to avoid trouble. +// SQL injection vectors. All integer array elements should be specifically +// cast to int to avoid trouble. if(! function_exists('dbesc_array_cb')) { @@ -336,4 +350,3 @@ function dbesc_array(&$arr) { function dba_timer() { return microtime(true); } -