Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/alex347/zf2 into alex347-ma…
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
Ralph Schindler committed Dec 19, 2012
2 parents 37cbdba + 40c2144 commit 3ce7e05
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
Expand Up @@ -166,7 +166,23 @@ public function connect()
$port = (isset($p['port'])) ? (int) $p['port'] : null;
$socket = (isset($p['socket'])) ? $p['socket'] : null;

$this->resource = new \mysqli($hostname, $username, $password, $database, $port, $socket);
$this->resource = new \mysqli();
$this->resource->init();

if (!empty($p['driver_options'])) {
foreach ($p['driver_options'] as $option => $value) {
if (is_string($option)) {
// Suppress warnings here
// Ignore it if it's not a valid constant
$option = @constant(strtoupper($option));
if ($option === null)
continue;
}
$this->resource->options($option, $value);
}
}

$this->resource->real_connect($hostname, $username, $password, $database, $port, $socket);

if ($this->resource->connect_error) {
throw new Exception\RuntimeException(
Expand Down

0 comments on commit 3ce7e05

Please sign in to comment.