Permalink
Browse files

lib MDL-25532 added dbport handling for during db creation

  • Loading branch information...
1 parent 59186c9 commit bac1401534c99c6f1563e3c07e1fb9f03927af3f @nebgor nebgor committed Dec 9, 2010
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/dml/mysqli_native_moodle_database.php
@@ -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;

0 comments on commit bac1401

Please sign in to comment.