Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/alex347/zf2 into alex347-ma…

…ster
  • Loading branch information...
commit 3ce7e0504dcdc50d571d44d9efb3d6dc11770179 2 parents 37cbdba + 40c2144
@ralphschindler ralphschindler authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
View
18 library/Zend/Db/Adapter/Driver/Mysqli/Connection.php
@@ -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(
Please sign in to comment.
Something went wrong with that request. Please try again.