HOR-4559
This commit is contained in:
@@ -1103,7 +1103,7 @@ EOREGEX;
|
||||
*/
|
||||
private function process_expr_list ($tokens)
|
||||
{
|
||||
$expr = "";
|
||||
$expr = [];
|
||||
$type = "";
|
||||
$prev_token = "";
|
||||
$skip_next = false;
|
||||
|
||||
@@ -258,22 +258,10 @@ class DbConnections
|
||||
|
||||
$dbServices = array ('mysql' => array ('id' => 'mysql','command' => 'mysqli_connect','name' => 'MySql'
|
||||
),'pgsql' => array ('id' => 'pgsql','command' => 'pg_connect','name' => 'PostgreSql'
|
||||
),'mssql' => array ('id' => 'mssql','command' => 'mssql_connect','name' => 'Microsoft SQL Server'
|
||||
),'mssql' => array ('id' => 'mssql','command' => 'mssql_connect','name' => 'Microsoft SQL Server (mssql extension)'
|
||||
),'sqlsrv' => array ('id' => 'mssql','command' => 'sqlsrv_connect','name' => 'Microsoft SQL Server (sqlsrv extension)'
|
||||
),'oracle' => array ('id' => 'oracle','command' => 'oci_connect','name' => 'Oracle'
|
||||
)
|
||||
);
|
||||
/*,
|
||||
'informix'=> Array(
|
||||
'id' => 'informix',
|
||||
'command' => 'ifx_connect',
|
||||
'name' => 'Informix'
|
||||
),
|
||||
'sqlite' => Array(
|
||||
'id' => 'sqlite',
|
||||
'command' => 'sqlite_open',
|
||||
'name' => 'SQLite'
|
||||
)
|
||||
*/
|
||||
));
|
||||
|
||||
foreach ($dbServices as $service) {
|
||||
if (@function_exists($service['command'])) {
|
||||
|
||||
@@ -253,12 +253,27 @@ class Net
|
||||
break;
|
||||
case 'mssql':
|
||||
//todo
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$str_port = "";
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$str_port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $str_port, $this->db_user, $this->db_passwd);
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
} else {
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = @sqlsrv_connect($server, $opt);
|
||||
}
|
||||
|
||||
if ($link) {
|
||||
@@ -382,15 +397,32 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$str_port = "";
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$str_port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $str_port, $this->db_user, $this->db_passwd);
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
} else {
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
$server = $this->ip;
|
||||
}
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ", " . $this->db_port;
|
||||
$server .= $port;
|
||||
$opt = [
|
||||
'UID' => $this->db_user,
|
||||
'PWD' => $this->db_passwd,
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = $db = @sqlsrv_connect($server, $opt);
|
||||
}
|
||||
if ($link) {
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
$db = @mssql_select_db($this->db_sourcename, $link);
|
||||
}
|
||||
if ($db) {
|
||||
$stat->status = 'SUCCESS';
|
||||
$this->errstr = "";
|
||||
|
||||
Reference in New Issue
Block a user