summaryrefslogtreecommitdiff
path: root/vendor/fguillot
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-01-29 16:14:53 -0800
committerFrédéric Guillot <fred@kanboard.net>2018-01-29 16:15:01 -0800
commita4231323ea1ac696a8aabe0399ac9f1a89c21ece (patch)
tree141d664d1ad634052b8c07e5cd9d103a9633c683 /vendor/fguillot
parent9ddefa979a12aff2334d6e7048e142cfdef5bb89 (diff)
Update PicoDB
Diffstat (limited to 'vendor/fguillot')
-rw-r--r--vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php b/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
index 4a589e87..94279492 100644
--- a/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
+++ b/vendor/fguillot/picodb/lib/PicoDb/Driver/Postgres.php
@@ -40,13 +40,15 @@ class Postgres extends Base
public function createConnection(array $settings)
{
$dsn = 'pgsql:dbname='.$settings['database'];
+ $username = null;
+ $password = null;
if (! empty($settings['username'])) {
- $dsn .= ';user='.$settings['username'];
+ $username = $settings['username'];
}
if (! empty($settings['password'])) {
- $dsn .= ';password='.$settings['password'];
+ $password = $settings['password'];
}
if (! empty($settings['hostname'])) {
@@ -57,7 +59,7 @@ class Postgres extends Base
$dsn .= ';port='.$settings['port'];
}
- $this->pdo = new PDO($dsn);
+ $this->pdo = new PDO($dsn, $username, $password);
if (isset($settings['schema_table'])) {
$this->schemaTable = $settings['schema_table'];