Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/bouncer:master commit in: php/lib/
Date: Tue, 30 Jan 2018 18:16:17
Message-Id: 1517262399.0c00dcb46e650589a387bd042735669402842468.grknight@gentoo
1 commit: 0c00dcb46e650589a387bd042735669402842468
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 29 21:46:39 2018 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 29 21:46:39 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=0c00dcb4
7
8 Bug fixes for some typos
9
10 php/lib/db.php | 6 +++---
11 php/lib/mirror.php | 2 ++
12 2 files changed, 5 insertions(+), 3 deletions(-)
13
14 diff --git a/php/lib/db.php b/php/lib/db.php
15 index 6882064..34e49e3 100644
16 --- a/php/lib/db.php
17 +++ b/php/lib/db.php
18 @@ -7,8 +7,8 @@
19
20 class DB {
21
22 - private $dsn;
23 - private $result;
24 + private static $dbh;
25 + private static $result;
26 /**
27 * Connect to a MySQL database server.
28 * @param string $host db server, defaults to localhost
29 @@ -20,7 +20,7 @@ public static function connect($host='localhost',$user=null,$password=null,$data
30 {
31 if (!empty($host) && isset($user) && isset($password)) {
32 $dsn = "mysql:host={$host}";
33 - if(!empty($database)) $dsn .= ";database={$database}";
34 + if(!empty($database)) $dsn .= ";dbname={$database}";
35 $options = [PDO::ATTR_EMULATE_PREPARES => false, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
36 static::$dbh = new PDO($dsn, $user, $password, $options);
37 }
38
39 diff --git a/php/lib/mirror.php b/php/lib/mirror.php
40 index ac3e904..564e33f 100644
41 --- a/php/lib/mirror.php
42 +++ b/php/lib/mirror.php
43 @@ -530,3 +530,5 @@ public static function get_product_stats()
44 mirror_locations.product_id
45 ");
46 }
47 +
48 +}