Refactor the database connector.

This commit is contained in:
Taylor Otwell 2011-08-08 10:51:01 -05:00
parent edae391593
commit a1956f016c
1 changed files with 4 additions and 1 deletions

View File

@ -79,7 +79,10 @@ private function connect_to_server($config)
{
$dsn = $config->driver.':host='.$config->host.';dbname='.$config->database;
if (isset($config->port)) $dsn .= ';port='.$config->port;
if (isset($config->port))
{
$dsn .= ';port='.$config->port;
}
$connection = new \PDO($dsn, $config->username, $config->password, $this->options);