Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Petar
ISPConfig 3
Commits
c6d4e838
Commit
c6d4e838
authored
9 years ago
by
Marius Cramer
Browse files
Options
Downloads
Patches
Plain Diff
- $app object not available in this mysql lib
parent
cf84b381
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
install/lib/mysql.lib.php
+4
-15
4 additions, 15 deletions
install/lib/mysql.lib.php
with
4 additions
and
15 deletions
install/lib/mysql.lib.php
+
4
−
15
View file @
c6d4e838
...
...
@@ -188,8 +188,6 @@ class db extends mysqli
}
private
function
_query
(
$sQuery
=
''
)
{
global
$app
;
$this
->
do_connect
();
if
(
$sQuery
==
''
)
{
...
...
@@ -206,10 +204,8 @@ class db extends mysqli
if
(
$this
->
errorNumber
==
'111'
)
{
// server is not available
if
(
$try
>
9
)
{
if
(
isset
(
$app
)
&&
isset
(
$app
->
forceErrorExit
))
{
$app
->
forceErrorExit
(
'Database connection failure!'
);
}
// if we reach this, the app object is missing or has no exit method, so we continue as normal
$this
->
_sqlerror
(
'DB::query -> error connecting'
);
exit
;
}
sleep
(
30
);
// additional seconds, please!
}
...
...
@@ -441,18 +437,13 @@ class db extends mysqli
* @return string escaped string
*/
public
function
escape
(
$sString
)
{
global
$app
;
if
(
!
is_string
(
$sString
)
&&
!
is_numeric
(
$sString
))
{
$app
->
log
(
'NON-String given in escape function! ('
.
gettype
(
$sString
)
.
')'
,
LOGLEVEL_INFO
);
//$sAddMsg = getDebugBacktrace();
$app
->
log
(
$sAddMsg
,
LOGLEVEL_DEBUG
);
$sString
=
''
;
}
$cur_encoding
=
mb_detect_encoding
(
$sString
);
if
(
$cur_encoding
!=
"UTF-8"
)
{
if
(
$cur_encoding
!=
'ASCII'
)
{
$app
->
log
(
'String '
.
substr
(
$sString
,
0
,
25
)
.
'... is '
.
$cur_encoding
.
'.'
,
LOGLEVEL_INFO
);
if
(
$cur_encoding
)
$sString
=
mb_convert_encoding
(
$sString
,
'UTF-8'
,
$cur_encoding
);
else
$sString
=
mb_convert_encoding
(
$sString
,
'UTF-8'
);
}
...
...
@@ -470,7 +461,7 @@ class db extends mysqli
* @access private
*/
private
function
_sqlerror
(
$sErrormsg
=
'Unbekannter Fehler'
,
$sAddMsg
=
''
)
{
global
$app
,
$conf
;
global
$conf
;
$mysql_error
=
(
is_object
(
$this
->
_iConnId
)
?
mysqli_error
(
$this
->
_iConnId
)
:
mysqli_connect_error
());
$mysql_errno
=
(
is_object
(
$this
->
_iConnId
)
?
mysqli_errno
(
$this
->
_iConnId
)
:
mysqli_connect_errno
());
...
...
@@ -479,9 +470,7 @@ class db extends mysqli
if
(
$this
->
show_error_messages
&&
$conf
[
'demo_mode'
]
===
false
)
{
echo
$sErrormsg
.
$sAddMsg
;
}
else
if
(
is_object
(
$app
)
&&
method_exists
(
$app
,
'log'
))
{
$app
->
log
(
$sErrormsg
.
$sAddMsg
.
' -> '
.
$mysql_errno
.
' ('
.
$mysql_error
.
')'
,
LOGLEVEL_WARN
);
}
}
}
public
function
affectedRows
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment