Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Anthony.Suerte
iwl-live
Commits
6d0c3621
Commit
6d0c3621
authored
Oct 04, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
System Debug Settings
parent
6a160d60
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
294 additions
and
19 deletions
+294
-19
DevComponents.php
system/api/dev/DevComponents.php
+0
-11
DevTools.php
system/api/dev/DevTools.php
+218
-4
common_base.php
system/lib/common_base.php
+15
-0
db_access.php
system/lib/db_access.php
+60
-3
model.php
system/logic/developer/model.php
+1
-1
No files found.
system/api/dev/DevComponents.php
View file @
6d0c3621
...
@@ -61,15 +61,4 @@ class DevComponents extends System {
...
@@ -61,15 +61,4 @@ class DevComponents extends System {
date
(
"Y-m-d H:i:s"
)
date
(
"Y-m-d H:i:s"
)
],
false
);
],
false
);
}
}
/**
*
* @param string $string
* @return boolean
*/
public
function
isJSON
(
$string
){
return
is_string
(
$string
)
&&
is_array
(
json_decode
(
$string
,
true
))
&&
(
json_last_error
()
==
JSON_ERROR_NONE
)
?
true
:
false
;
}
}
}
\ No newline at end of file
system/api/dev/DevTools.php
View file @
6d0c3621
This diff is collapsed.
Click to expand it.
system/lib/common_base.php
View file @
6d0c3621
...
@@ -110,6 +110,21 @@ class CommonBase {
...
@@ -110,6 +110,21 @@ class CommonBase {
}
}
}
}
/*-------------------------------------------------------------------------
* @function_name: デバッグコンフィグレーション
* @parameter : なし
* @return : bool|string
-------------------------------------------------------------------------*/
public
function
getDebuggerConf
(){
$debugContainer
=
LIBRARIES
.
"debug-container.txt"
;
if
(
@
file_exists
(
$debugContainer
)){
return
file_get_contents
(
$debugContainer
);
}
return
false
;
}
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* @function_name: 提示文言多语言设置
* @function_name: 提示文言多语言设置
* @parameter :
* @parameter :
...
...
system/lib/db_access.php
View file @
6d0c3621
<?php
<?php
use
Defuse\Crypto\Crypto
;
class
DBAccess
extends
Cnnector
{
class
DBAccess
extends
Cnnector
{
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
...
@@ -6,6 +8,10 @@ class DBAccess extends Cnnector {
...
@@ -6,6 +8,10 @@ class DBAccess extends Cnnector {
-------------------------------------------------------------------------*/
-------------------------------------------------------------------------*/
public
$sqlXml
;
// SQLファイルの配列
public
$sqlXml
;
// SQLファイルの配列
private
$debugConf
;
private
$cryptConf
;
private
$containerContent
;
/*-------------------------------------------------------------------------
/*-------------------------------------------------------------------------
* @function_name: DBアクセスクラスコンストラクタ
* @function_name: DBアクセスクラスコンストラクタ
* @detail : スーパークラスのコンストラクタを呼び出す
* @detail : スーパークラスのコンストラクタを呼び出す
...
@@ -31,6 +37,7 @@ class DBAccess extends Cnnector {
...
@@ -31,6 +37,7 @@ class DBAccess extends Cnnector {
throw
new
Exception
(
$this
->
getMessage
(
ERROR
,
E_CAN_NOT_OPEN_SQL_FILE
,
array
()),
-
1
);
throw
new
Exception
(
$this
->
getMessage
(
ERROR
,
E_CAN_NOT_OPEN_SQL_FILE
,
array
()),
-
1
);
}
}
$this
->
cryptConf
=
$this
->
getDebuggerConf
();
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
die
(
$e
->
getMessage
()
.
'<br>'
);
die
(
$e
->
getMessage
()
.
'<br>'
);
}
}
...
@@ -51,7 +58,6 @@ class DBAccess extends Cnnector {
...
@@ -51,7 +58,6 @@ class DBAccess extends Cnnector {
$result
;
// 結果セット
$result
;
// 結果セット
try
{
try
{
// SQL発行
// SQL発行
$result
=
$this
->
publishSQL
(
$sqlId
,
$elementArr
);
$result
=
$this
->
publishSQL
(
$sqlId
,
$elementArr
);
...
@@ -103,7 +109,6 @@ class DBAccess extends Cnnector {
...
@@ -103,7 +109,6 @@ class DBAccess extends Cnnector {
$result
;
// 結果セット
$result
;
// 結果セット
try
{
try
{
// SQL発行
// SQL発行
$result
=
$this
->
publishSQL
(
$sqlId
,
$elementArr
);
$result
=
$this
->
publishSQL
(
$sqlId
,
$elementArr
);
...
@@ -128,7 +133,7 @@ class DBAccess extends Cnnector {
...
@@ -128,7 +133,7 @@ class DBAccess extends Cnnector {
$result
;
// 結果セット
$result
;
// 結果セット
try
{
try
{
$this
->
debugQuery
(
$sqlId
,
$elementArr
);
// パラメータを設定する
// パラメータを設定する
$sqlString
=
$this
->
setElementParam
(
$sqlId
,
$elementArr
);
$sqlString
=
$this
->
setElementParam
(
$sqlId
,
$elementArr
);
...
@@ -147,6 +152,58 @@ class DBAccess extends Cnnector {
...
@@ -147,6 +152,58 @@ class DBAccess extends Cnnector {
return
(
$result
);
return
(
$result
);
}
}
/*-------------------------------------------------------------------------
* @function_name: デバッグクエリー
* @parameter : SQLID,パラメータ配列
* @return : bool
-------------------------------------------------------------------------*/
private
function
debugQuery
(
$sqlId
,
$elementArr
){
if
(
!
$this
->
cryptConf
)
return
false
;
if
(
!
isset
(
$this
->
debugConf
)){
$sqlString
=
$this
->
setElementParam
(
"SELECT_DEV_SETTING"
,
[
"sys_debug_conf"
]);
$result
=
$this
->
getRowData
(
$this
->
rawSQL
(
$sqlString
));
if
(
$this
->
checkJSONString
(
$result
[
"dev_setting_value"
]))
$this
->
debugConf
=
json_decode
(
$result
[
"dev_setting_value"
]);
}
$ipAddress
=
$_SERVER
[
"REMOTE_ADDR"
];
if
(
!
isset
(
$this
->
containerContent
)){
$this
->
containerContent
=
Crypto
::
decryptWithPassword
(
$this
->
cryptConf
,
$this
->
debugConf
->
debugger_passphrase
);
$this
->
containerContent
=
json_decode
(
$this
->
containerContent
);
}
if
(
!
$this
->
containerContent
->
enabled
)
return
false
;
if
(
in_array
(
$ipAddress
,
$this
->
containerContent
->
ip_address
)){
$queryMap
=
array_map
(
function
(
$element
){
return
$element
->
query_name
;
},
$this
->
containerContent
->
my_commands
);
if
(
in_array
(
$sqlId
,
$queryMap
)){
foreach
(
$this
->
containerContent
->
my_commands
as
$query
){
if
(
$query
->
query_name
==
$sqlId
){
$displayFunc
=
$query
->
display_func
;
$dispAsPreTag
=
$query
->
dp_pre_tag
;
$queryString
=
$this
->
setElementParam
(
$sqlId
,
$elementArr
);
$display
=
(
$dispAsPreTag
)
?
"<pre>
{
$queryString
}
</pre>"
:
$queryString
;
$displayFunc
==
"die"
?
die
(
$display
)
:
print
(
$display
);
break
;
}
}
}
}
return
true
;
}
public
function
rawSQL
(
$sqlString
){
public
function
rawSQL
(
$sqlString
){
$result
=
NO_STRING
;
$result
=
NO_STRING
;
...
...
system/logic/developer/model.php
View file @
6d0c3621
...
@@ -124,7 +124,7 @@ class DeveloperModelClass extends ModelClassEx {
...
@@ -124,7 +124,7 @@ class DeveloperModelClass extends ModelClassEx {
switch
(
$this
->
getType
()){
switch
(
$this
->
getType
()){
case
TYPE_DEV_CREDENTIAL_EDIT
:
case
TYPE_DEV_CREDENTIAL_EDIT
:
case
TYPE_DEV_CREDENTIAL_MODIFY_PASSCODE
:
case
TYPE_DEV_CREDENTIAL_MODIFY_PASSCODE
:
case
TYPE_DEV_CREDENTIAL_
UPDATE_PASSCOD
E
:
case
TYPE_DEV_CREDENTIAL_
PASSCODE_UPDAT
E
:
case
TYPE_DEV_CREDENTIAL_UPDATE
:
case
TYPE_DEV_CREDENTIAL_UPDATE
:
if
(
!
$this
->
checkAdminUserAccess
(
'DEVF'
,
array
(
''
,
'1'
))){
if
(
!
$this
->
checkAdminUserAccess
(
'DEVF'
,
array
(
''
,
'1'
))){
$this
->
popUpSessionMessage
(
ERROR
,
'E_ERROR_NO_PAGE_ACCESS'
,
array
());
$this
->
popUpSessionMessage
(
ERROR
,
'E_ERROR_NO_PAGE_ACCESS'
,
array
());
...
...
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