Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai
noblogs-wp
Commits
13421bc7
Commit
13421bc7
authored
May 03, 2013
by
joe
Committed by
agata
Jul 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added optional logging
parent
e54f9ac7
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 @
13421bc7
...
...
@@ -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