mirror of
https://github.com/vrana/adminer.git
synced 2025-08-16 19:44:00 +02:00
Support PHP 7
This commit is contained in:
@@ -13,16 +13,16 @@ if (!defined("DRIVER")) {
|
||||
parent::init();
|
||||
}
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
function connect($server = "", $username = "", $password = "", $database = null, $port = null, $socket = null) {
|
||||
mysqli_report(MYSQLI_REPORT_OFF); // stays between requests, not required since PHP 5.3.4
|
||||
list($host, $port) = explode(":", $server, 2); // part after : is used for port or socket
|
||||
$return = @$this->real_connect(
|
||||
($server != "" ? $host : ini_get("mysqli.default_host")),
|
||||
($server . $username != "" ? $username : ini_get("mysqli.default_user")),
|
||||
($server . $username . $password != "" ? $password : ini_get("mysqli.default_pw")),
|
||||
null,
|
||||
$database,
|
||||
(is_numeric($port) ? $port : ini_get("mysqli.default_port")),
|
||||
(!is_numeric($port) ? $port : null)
|
||||
(!is_numeric($port) ? $port : $socket)
|
||||
);
|
||||
return $return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user