Changeset:
        b3c432bb1344
        
https://sourceforge.net/p/mrbs/hg-code/ci/b3c432bb1344637bfb6bad97948dbfb435b5a7b7
Author:
        John Beranek <jbera...@users.sourceforge.net>
Date:
        Sat Sep 17 18:57:21 2016 +0100
Log message:

Fixed a few things in mysqli abstraction, and removed TABs from pgsql.inc

diffstat:

 web/mysqli.inc |  19 +++++--------------
 web/pgsql.inc  |  18 +++++++++---------
 2 files changed, 14 insertions(+), 23 deletions(-)

diffs (94 lines):

diff -r aa651180c556 -r b3c432bb1344 web/mysqli.inc
--- a/web/mysqli.inc    Sat Sep 17 18:41:48 2016 +0100
+++ b/web/mysqli.inc    Sat Sep 17 18:57:21 2016 +0100
@@ -291,7 +291,7 @@
   }
   
   // Rollback any outstanding transactions
-//  sql_mysqli_rollback($db_conn);
+  sql_mysqli_rollback($db_conn);
 }
 
 
@@ -563,21 +563,12 @@
   // there seems to be no way to supress the automatic error message output and
   // still be able to access the error text.
 
-  // PHP 5.3.0 and above support persistent connections in mysqli
-  if ($persist && (version_compare(PHP_VERSION, '5.3.0') >= 0))
-  {
-    $full_host = "p:$host";
-  }
-  else
-  {
-    $full_host = $host;
-  }
-  
-//  $db_conn = new mysqli($full_host, $username, $password, $db_name, 
$db_port);
-
   try
   {
-    $db_conn = new 
PDO("mysql:host=$host;port=$db_port;dbname=$db_name;charset=UTF8",$username,$password);
+    $db_conn = new 
PDO("mysql:host=$host;port=$db_port;dbname=$db_name;charset=UTF8",
+                       $username,
+                       $password
+                       array(PDO::ATTR_PERSISTENT => ($persist ? true : 
false)));
   }
   catch (PDOException $e)
   {
diff -r aa651180c556 -r b3c432bb1344 web/pgsql.inc
--- a/web/pgsql.inc     Sat Sep 17 18:41:48 2016 +0100
+++ b/web/pgsql.inc     Sat Sep 17 18:57:21 2016 +0100
@@ -138,9 +138,9 @@
   if (($sth->rowCount() == 1) &&
       ($sth->columnCount() == 1))
   {
-       $row = $sth->fetch(PDO::FETCH_NUM);
-       if ($row != NULL)
-       {
+    $row = $sth->fetch(PDO::FETCH_NUM);
+    if ($row != NULL)
+    {
       $result = $row[0];
     }
   }
@@ -323,7 +323,7 @@
   
   if (!$db_conn)
   {
-       return;
+    return;
   }
   // Release any forgotten locks
   if (!empty($sql_pgsql_mutex_unlock_name))
@@ -477,7 +477,7 @@
   if (isset($table_parts['table_schema']))
   {
     $sql .= " AND table_schema = ?";
-       $sql_params[] = $table_parts['table_schema'];
+    $sql_params[] = $table_parts['table_schema'];
   }
 
   $res = sql_pgsql_query1($sql, $sql_params, $db_conn);
@@ -533,7 +533,7 @@
   if (isset($table_parts['table_schema']))
   {
     $sql .= " AND table_schema = ?";
-       $sql_params[] = $table_parts['table_schema'];
+    $sql_params[] = $table_parts['table_schema'];
   }
   $sql .= "ORDER BY ordinal_position";
   
@@ -606,9 +606,9 @@
   try
   {
     $db_conn = new PDO("pgsql:host=$host;port=$db_port;dbname=$db_name",
-                          $username,
-                                          $password,
-                                          array(PDO::ATTR_PERSISTENT => 
($persist ? true : false)));
+                       $username,
+                       $password,
+                       array(PDO::ATTR_PERSISTENT => ($persist ? true : 
false)));
   }
   catch (PDOException $e)
   {

------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
Mrbs-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to