Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
b70b348f
Commit
b70b348f
authored
Mar 06, 2021
by
金枪银矛小霸王
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #271
1. fix #271 2. 修改 PHP 兼容性代码 3. 修改 postgresql 链接格式 4. 修订错别字
parent
b30ef6c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
26 deletions
+48
-26
mysqli.js
source/core/php/template/database/mysqli.js
+8
-8
postgresql.js
source/core/php/template/database/postgresql.js
+21
-8
postgresql_pdo.js
source/core/php/template/database/postgresql_pdo.js
+11
-8
sqlsrv.js
source/core/php/template/database/sqlsrv.js
+1
-1
index.js
source/modules/database/php/index.js
+7
-1
No files found.
source/core/php/template/database/mysqli.js
View file @
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);
...
...
source/core/php/template/database/postgresql.js
View file @
b70b348f
...
@@ -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,
...
...
source/core/php/template/database/postgresql_pdo.js
View file @
b70b348f
...
@@ -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,
...
...
source/core/php/template/database/sqlsrv.js
View file @
b70b348f
/**
/**
* 数据库管理模板::sqlsrv
* 数据库管理模板::sqlsrv
* php >= 5.3 原生不支持 mssql, 可
彩
sqlsrv 连接 sqlserver
* php >= 5.3 原生不支持 mssql, 可
采用
sqlsrv 连接 sqlserver
* i 数据分隔符号 => \t|\t
* i 数据分隔符号 => \t|\t
*/
*/
...
...
source/modules/database/php/index.js
View file @
b70b348f
...
@@ -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
:
''
,
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment