commit:     0c00dcb46e650589a387bd042735669402842468
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 29 21:46:39 2018 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Mon Jan 29 21:46:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=0c00dcb4

Bug fixes for some typos

 php/lib/db.php     | 6 +++---
 php/lib/mirror.php | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/php/lib/db.php b/php/lib/db.php
index 6882064..34e49e3 100644
--- a/php/lib/db.php
+++ b/php/lib/db.php
@@ -7,8 +7,8 @@
 
 class DB {
 
-       private $dsn;
-       private $result;
+       private static $dbh;
+       private static $result;
 /**
  *  Connect to a MySQL database server.
  *  @param string $host db server, defaults to localhost
@@ -20,7 +20,7 @@ public static function 
connect($host='localhost',$user=null,$password=null,$data
 {
     if (!empty($host) && isset($user) && isset($password)) {
        $dsn = "mysql:host={$host}";
-       if(!empty($database)) $dsn .= ";database={$database}";
+       if(!empty($database)) $dsn .= ";dbname={$database}";
        $options = [PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => 
PDO::ERRMODE_EXCEPTION];
         static::$dbh = new PDO($dsn, $user, $password, $options);
     }

diff --git a/php/lib/mirror.php b/php/lib/mirror.php
index ac3e904..564e33f 100644
--- a/php/lib/mirror.php
+++ b/php/lib/mirror.php
@@ -530,3 +530,5 @@ public static function get_product_stats()
             mirror_locations.product_id
     ");
 }
+
+}

Reply via email to