Unverified Commit 97bff03f authored by Medicean's avatar Medicean Committed by GitHub

Merge pull request #275 from Ch1ngg/v2.1.x

fix #271
parents b30ef6c2 b70b348f
...@@ -10,8 +10,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -10,8 +10,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"]; $hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"]; $usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$port=explode(":",$hst)[1]; list($hst, $port) = split(":", $hst);
$hst=explode(":",$hst)[0]; $port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port); $T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T,"SHOW DATABASES"); $q=@mysqli_query($T,"SHOW DATABASES");
while($rs=@mysqli_fetch_row($q)){ while($rs=@mysqli_fetch_row($q)){
...@@ -29,8 +29,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -29,8 +29,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"]; $usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$port=explode(":",$hst)[1]; list($hst, $port) = split(":", $hst);
$hst=explode(":",$hst)[0]; $port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port); $T=@mysqli_connect($hst,$usr,$pwd,"",$port);
$q=@mysqli_query($T, "SHOW TABLES FROM \`{$dbn}\`"); $q=@mysqli_query($T, "SHOW TABLES FROM \`{$dbn}\`");
while($rs=@mysqli_fetch_row($q)){ while($rs=@mysqli_fetch_row($q)){
...@@ -50,8 +50,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -50,8 +50,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"]; $tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$port=explode(":",$hst)[1]; list($hst, $port) = split(":", $hst);
$hst=explode(":",$hst)[0]; $port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port); $T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_select_db($T, $dbn); @mysqli_select_db($T, $dbn);
$q=@mysqli_query($T, "SHOW COLUMNS FROM \`{$tab}\`"); $q=@mysqli_query($T, "SHOW COLUMNS FROM \`{$tab}\`");
...@@ -73,8 +73,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -73,8 +73,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]); $sql=base64_decode($_POST["${arg5}"]);
$port=explode(":",$hst)[1]; list($hst, $port) = split(":", $hst);
$hst=explode(":",$hst)[0]; $port == "" ? $port = "3306" : $port;
$T=@mysqli_connect($hst,$usr,$pwd,"",$port); $T=@mysqli_connect($hst,$usr,$pwd,"",$port);
@mysqli_query($T,"SET NAMES $_POST[${arg6}]"); @mysqli_query($T,"SET NAMES $_POST[${arg6}]");
@mysqli_select_db($T,$dbn); @mysqli_select_db($T,$dbn);
......
...@@ -10,11 +10,16 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -10,11 +10,16 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"]; $hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"]; $usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
list($host,$port,$dbn) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array( $arr=array(
'host'=>explode(':',$hst)[0], 'host'=>$host,
'port'=>explode(':',$hst)[1], 'port'=>$port,
'user'=>$usr, 'user'=>$usr,
'password'=>$pwd, 'password'=>$pwd,
'dbname'=>$dbn
); );
$cs=''; $cs='';
foreach($arr as $k=>$v) { foreach($arr as $k=>$v) {
...@@ -49,9 +54,12 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -49,9 +54,12 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"]; $usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array( $arr=array(
'host'=>explode(':',$hst)[0], 'host'=>$host,
'port'=>explode(':',$hst)[1], 'port'=>$port,
'user'=>$usr, 'user'=>$usr,
'password'=>$pwd, 'password'=>$pwd,
'dbname'=>$dbn, 'dbname'=>$dbn,
...@@ -91,9 +99,12 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -91,9 +99,12 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"]; $tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array( $arr=array(
'host'=>explode(':',$hst)[0], 'host'=>$host,
'port'=>explode(':',$hst)[1], 'port'=>$port,
'user'=>$usr, 'user'=>$usr,
'password'=>$pwd, 'password'=>$pwd,
'dbname'=>$dbn, 'dbname'=>$dbn,
...@@ -136,9 +147,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -136,9 +147,11 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]); $sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"]; $encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
list($host, $port) = split(":", $hst);
$port == "" ? $port = "5432" : $port;
$arr=array( $arr=array(
'host'=>explode(':',$hst)[0], 'host'=>$host,
'port'=>explode(':',$hst)[1], 'port'=>$port,
'user'=>$usr, 'user'=>$usr,
'password'=>$pwd, 'password'=>$pwd,
'dbname'=>$dbn, 'dbname'=>$dbn,
......
...@@ -10,11 +10,14 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -10,11 +10,14 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"]; $hst=$m?stripslashes($_POST["${arg1}"]):$_POST["${arg1}"];
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"]; $usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$host=explode(':',$hst)[0]; list($host, $port,$dbn) = split(":", $hst);
$port=explode(':',$hst)[1]; $port == "" ? $port = "5432" : $port;
$dbn == "" ? $dbn = "postgres" : $dbn;
$arr=array( $arr=array(
'host'=>$host, 'host'=>$host,
'port'=>$port, 'port'=>$port,
'dbname'=>$dbn
); );
$cs='pgsql:'; $cs='pgsql:';
foreach($arr as $k=>$v) { foreach($arr as $k=>$v) {
...@@ -46,8 +49,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -46,8 +49,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"]; $usr=$m?stripslashes($_POST["${arg2}"]):$_POST["${arg2}"];
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$host=explode(':',$hst)[0]; list($host, $port) = split(":", $hst);
$port=explode(':',$hst)[1]; $port == "" ? $port = "5432" : $port;
$arr=array( $arr=array(
'host'=>$host, 'host'=>$host,
'port'=>$port, 'port'=>$port,
...@@ -85,8 +88,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -85,8 +88,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"]; $pwd=$m?stripslashes($_POST["${arg3}"]):$_POST["${arg3}"];
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"]; $tab=$m?stripslashes($_POST["${arg5}"]):$_POST["${arg5}"];
$host=explode(':',$hst)[0]; list($host, $port) = split(":", $hst);
$port=explode(':',$hst)[1]; $port == "" ? $port = "5432" : $port;
$arr=array( $arr=array(
'host'=>$host, 'host'=>$host,
'port'=>$port, 'port'=>$port,
...@@ -127,8 +130,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({ ...@@ -127,8 +130,8 @@ module.exports = (arg1, arg2, arg3, arg4, arg5, arg6) => ({
$dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"]; $dbn=$m?stripslashes($_POST["${arg4}"]):$_POST["${arg4}"];
$sql=base64_decode($_POST["${arg5}"]); $sql=base64_decode($_POST["${arg5}"]);
$encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"]; $encode=$m?stripslashes($_POST["${arg6}"]):$_POST["${arg6}"];
$host=explode(':',$hst)[0]; list($host, $port) = split(":", $hst);
$port=explode(':',$hst)[1]; $port == "" ? $port = "5432" : $port;
$arr=array( $arr=array(
'host'=>$host, 'host'=>$host,
'port'=>$port, 'port'=>$port,
......
/** /**
* 数据库管理模板::sqlsrv * 数据库管理模板::sqlsrv
* php >= 5.3 原生不支持 mssql, 可 sqlsrv 连接 sqlserver * php >= 5.3 原生不支持 mssql, 可采用 sqlsrv 连接 sqlserver
* i 数据分隔符号 => \t|\t * i 数据分隔符号 => \t|\t
*/ */
......
...@@ -412,9 +412,15 @@ class PHP { ...@@ -412,9 +412,15 @@ class PHP {
}) })
break; break;
case 'postgresql': case 'postgresql':
form.setFormData({
host: 'localhost:5432:postgres',
user: 'postgres',
passwd: '',
});
break;
case 'postgresql_pdo': case 'postgresql_pdo':
form.setFormData({ form.setFormData({
host: 'localhost:5432', host: 'localhost:5432:postgres',
user: 'postgres', user: 'postgres',
passwd: '', passwd: '',
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment