Skip to content

Commit

Permalink
lib MDL-25532 added dbport handling for during db creation
Browse files Browse the repository at this point in the history
  • Loading branch information
nebgor committed Dec 9, 2010
1 parent 59186c9 commit bac1401
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/dml/mysqli_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ public function create_database($dbhost, $dbuser, $dbpass, $dbname, array $dbopt
throw new dml_exception('dbdriverproblem', $driverstatus);
}

if (empty($this->dboptions['dbport'])) {
$dbport = ini_get('mysqli.default_port');
} else {
$dbport = (int)$this->dboptions['dbport'];
}
ob_start();
$conn = new mysqli($dbhost, $dbuser, $dbpass); /// Connect without db
$conn = new mysqli($dbhost, $dbuser, $dbpass, '', $dbport); /// Connect without db
$dberr = ob_get_contents();
ob_end_clean();
$errorno = @$conn->connect_errno;
Expand Down

0 comments on commit bac1401

Please sign in to comment.