Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
noblogs-wp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
39
Issues
39
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ai
noblogs-wp
Commits
6cd241ca
Commit
6cd241ca
authored
May 03, 2013
by
joe
Committed by
agata
Oct 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added optional logging
parent
d5e50962
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
wp-content/db.php
wp-content/db.php
+17
-14
No files found.
wp-content/db.php
View file @
6cd241ca
...
...
@@ -55,7 +55,7 @@ define( 'HYPERDB_SERVER_GONE_ERROR', 2006 ); // MySQL server has gone away
class
hyperdb
extends
wpdb
{
/**
* A/I patch!
* A/I patch!
* store a FlexiHash() instance here.
*/
var
$hash_map
;
...
...
@@ -680,16 +680,19 @@ class hyperdb extends wpdb {
$success
=
false
;
$this
->
last_connection
=
compact
(
'dbhname'
,
'host'
,
'port'
,
'user'
,
'name'
,
'tcp'
,
'elapsed'
,
'success'
);
$this
->
db_connections
[]
=
$this
->
last_connection
;
$msg
=
date
(
"Y-m-d H:i:s"
)
.
" Can't select
$dbhname
-
\n
"
;
$msg
.
=
"'referrer' => '
{
$_SERVER
[
'HTTP_HOST'
]
}{
$_SERVER
[
'REQUEST_URI'
]
}
',
\n
"
;
$msg
.
=
"'server' =>
{
$server
}
,
\n
"
;
$msg
.
=
"'host' =>
{
$host
}
,
\n
"
;
$msg
.
=
"'error' => "
.
$this
->
ex_mysql_error
()
.
",
\n
"
;
$msg
.
=
"'errno' => "
.
$this
->
ex_mysql_errno
()
.
",
\n
"
;
$msg
.
=
"'server_state' =>
$server_state
\n
"
;
$msg
.
=
"'lagged_status' => "
.
(
isset
(
$lagged_status
)
?
$lagged_status
:
HYPERDB_LAG_UNKNOWN
);
$this
->
print_error
(
$msg
);
/* Workaround to stop logging a/i */
if
(
AI_LOG_HYPERDB
==
true
)
{
$msg
=
date
(
"Y-m-d H:i:s"
)
.
" Can't select
$dbhname
-
\n
"
;
$msg
.
=
"'referrer' => '
{
$_SERVER
[
'HTTP_HOST'
]
}{
$_SERVER
[
'REQUEST_URI'
]
}
',
\n
"
;
$msg
.
=
"'server' =>
{
$server
}
,
\n
"
;
$msg
.
=
"'host' =>
{
$host
}
,
\n
"
;
$msg
.
=
"'error' => "
.
$this
->
ex_mysql_error
()
.
",
\n
"
;
$msg
.
=
"'errno' => "
.
$this
->
ex_mysql_errno
()
.
",
\n
"
;
$msg
.
=
"'server_state' =>
$server_state
\n
"
;
$msg
.
=
"'lagged_status' => "
.
(
isset
(
$lagged_status
)
?
$lagged_status
:
HYPERDB_LAG_UNKNOWN
);
$this
->
print_error
(
$msg
);
}
}
if
(
!
$success
||
!
isset
(
$this
->
dbhs
[
$dbhname
]
)
||
!
$this
->
is_mysql_connection
(
$this
->
dbhs
[
$dbhname
]
)
)
{
...
...
@@ -723,8 +726,8 @@ class hyperdb extends wpdb {
$collate
=
null
;
$this
->
set_charset
(
$this
->
dbhs
[
$dbhname
],
$charset
,
$collate
);
if
(
!
isset
(
$charset
)
)
if
(
!
isset
(
$charset
)
)
$charset
=
null
;
if
(
!
isset
(
$collate
)
)
...
...
@@ -885,7 +888,7 @@ class hyperdb extends wpdb {
if
(
strpos
(
$_SERVER
[
'REQUEST_URI'
],
'/wp-admin/'
)
!==
false
)
{
$query
.
=
' /* NO CACHE */'
;
}
$this
->
timer_start
();
if
(
$statement_before_query
)
{
$query_for_log
=
"
$statement_before_query
;
$query_for_log
"
;
...
...
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