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
97bff03f
Unverified
Commit
97bff03f
authored
Mar 07, 2021
by
Medicean
Committed by
GitHub
Mar 07, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #275 from Ch1ngg/v2.1.x
fix #271
parents
b30ef6c2
b70b348f
Changes
5
Show 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 @
97bff03f
...
@@ -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 @
97bff03f
...
@@ -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 @
97bff03f
...
@@ -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 @
97bff03f
/**
/**
* 数据库管理模板::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 @
97bff03f
...
@@ -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