Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
f444cfc0
Commit
f444cfc0
authored
Jan 09, 2020
by
Carsten Rose
Browse files
Merge branch 'develop' into 'master'
Develop See merge request
!236
parents
61c76099
95ac7b5c
Pipeline
#3113
passed with stages
in 1 minute and 52 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Core/Constants.php
View file @
f444cfc0
...
...
@@ -783,7 +783,6 @@ const RANDOM_LENGTH = 32;
// SQL logging Modes
const
SQL_LOG_MODE_ALL
=
'all'
;
const
SQL_LOG_MODE_MODIFY
=
'modify'
;
const
SQL_LOG_MODE_MODIFY_ALL
=
'modifyAll'
;
const
SQL_LOG_MODE_NONE
=
'none'
;
const
SQL_LOG_MODE_ERROR
=
'error'
;
...
...
extension/Classes/Core/Database/Database.php
View file @
f444cfc0
...
...
@@ -50,7 +50,7 @@ class Database {
/**
* @var array
*/
private
$sqlLogModePrio
=
[
SQL_LOG_MODE_NONE
=>
1
,
SQL_LOG_MODE_ERROR
=>
2
,
SQL_LOG_MODE_MODIFY
=>
3
,
SQL_LOG_MODE_
MODIFY_
ALL
=>
4
,
SQL_LOG_MODE_ALL
=>
5
];
private
$sqlLogModePrio
=
[
SQL_LOG_MODE_NONE
=>
1
,
SQL_LOG_MODE_ERROR
=>
2
,
SQL_LOG_MODE_MODIFY
=>
3
,
SQL_LOG_MODE_ALL
=>
4
];
private
$dbName
=
''
;
...
...
@@ -74,7 +74,7 @@ class Database {
$this
->
store
=
Store
::
getInstance
();
$storeSystem
=
$this
->
store
->
getStore
(
STORE_SYSTEM
);
$this
->
sqlLog
=
$storeSystem
[
SYSTEM_SITE_PATH
]
.
'/'
.
$storeSystem
[
SYSTEM_SQL_LOG
];
$this
->
sqlLog
=
$storeSystem
[
SYSTEM_SQL_LOG
];
$dbInit
=
$storeSystem
[
SYSTEM_DB_INIT
];
$config
=
$this
->
getConnectionDetails
(
$dbIndex
,
$storeSystem
);
...
...
@@ -358,9 +358,7 @@ class Database {
*/
private
function
prepareExecute
(
$sql
,
array
$parameterArray
,
&
$queryType
,
array
&
$stat
,
$specificMessage
=
''
,
array
$skipErrno
=
array
())
{
// Only log a modify type statement here if sqlLogMode is (at least) modifyAll
// If sqlLogMode is modify, log the statement after it has been executed and we know if there are affected rows.
$sqlLogMode
=
$this
->
isSqlModify
(
$sql
)
?
SQL_LOG_MODE_MODIFY_ALL
:
SQL_LOG_MODE_ALL
;
$sqlLogMode
=
$this
->
isSqlModify
(
$sql
)
?
SQL_LOG_MODE_MODIFY
:
SQL_LOG_MODE_ALL
;
$errno
=
0
;
$result
=
0
;
...
...
@@ -489,18 +487,7 @@ class Database {
$this
->
store
->
setVar
(
SYSTEM_SQL_COUNT
,
$count
,
STORE_SYSTEM
);
}
// Logfile
$pageContentSqlLogMode
=
$this
->
store
->
getVar
(
SYSTEM_SQL_LOG_MODE
,
STORE_SYSTEM
);
if
(
$pageContentSqlLogMode
==
SQL_LOG_MODE_MODIFY
&&
$sqlLogMode
==
SQL_LOG_MODE_MODIFY_ALL
)
{
// sqlLogMode modify: need to log query and query result (if count > 0)
if
(
$count
>
0
)
{
$this
->
dbLog
(
SQL_LOG_MODE_MODIFY
,
$sql
,
$parameterArray
);
$this
->
dbLog
(
SQL_LOG_MODE_MODIFY
,
$msg
);
}
}
else
{
// Query result
$this
->
dbLog
(
$sqlLogMode
,
$msg
);
}
$this
->
dbLog
(
$sqlLogMode
,
$msg
);
return
$count
;
}
...
...
Write
Preview
Supports
Markdown
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