Well, I was trying to work around a problem I had with NeDi and my mariadb. Our security folk won't let us run databases on default ports or sockets. While I can define dbhost like this:
dbhost 127.0.0.1:3402
Only nedi.pl works. The web GUI doesn't. Really, all I want is the ability to do this in the config:
dbhost 127.0.0.1
dbport 3402
cactihost 127.0.0.1
cactiport 3402
Right now I use 127.0.0.1:3402 for dbhost and cactihost, and hacked /html/inc/libdb-mysql.php. That said, my solution is ugly - I don't know php, so I just did this:
function DbConnect($host,$user,$pass,$db){
$host = '127.0.0.1';
$port = 3402;
$l = mysqli_connect($host,$user,$pass,$db,$port) or die("Could not connect to $db@$host $port with $user");
mysqli_set_charset($l, "utf8"); # Some stubborn servers need this, tx Nils
return $l;
}
It works, but its an ugly hard coded hack.