Skip to content
Snippets Groups Projects
Commit 94444d26 authored by pzaremba's avatar pzaremba
Browse files

Adding support for database connection on a non-standard port.

Just add ":port" to the DBHOST during the installation.
parent 3e3544cb
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,13 @@ function db_connect($host, $user, $passwd, $options = array()) {
//Connectr
$start = microtime(true);
if(!@$__db->real_connect($host, $user, $passwd)) # nolint
$port = 3306;
if (strpos($host, ':') !== false) {
$_host = explode(':', $host);
$host = $_host[0];
$port = (int) $_host[1];
}
if (!@$__db->real_connect($host, $user, $passwd, null, $port)) # nolint
return NULL;
//Select the database, if any.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment