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
Container Registry
Model registry
Operate
Environments
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
Webslice
ISPConfig 3
Commits
aa8d9264
Commit
aa8d9264
authored
6 years ago
by
Till Brehm
Browse files
Options
Downloads
Plain Diff
Merge branch 'stable-3.1' of git.ispconfig.org:ispconfig/ispconfig3 into stable-3.1
parents
f5bb3553
b9b97e2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
interface/lib/classes/db_mysql.inc.php
+6
-9
6 additions, 9 deletions
interface/lib/classes/db_mysql.inc.php
server/lib/app.inc.php
+1
-1
1 addition, 1 deletion
server/lib/app.inc.php
server/lib/classes/db_mysql.inc.php
+8
-11
8 additions, 11 deletions
server/lib/classes/db_mysql.inc.php
with
15 additions
and
21 deletions
interface/lib/classes/db_mysql.inc.php
+
6
−
9
View file @
aa8d9264
...
@@ -74,18 +74,15 @@ class db {
...
@@ -74,18 +74,15 @@ class db {
$this
->
dbCharset
=
$conf
[
$prefix
.
'db_charset'
];
$this
->
dbCharset
=
$conf
[
$prefix
.
'db_charset'
];
$this
->
dbNewLink
=
$conf
[
$prefix
.
'db_new_link'
];
$this
->
dbNewLink
=
$conf
[
$prefix
.
'db_new_link'
];
$this
->
dbClientFlags
=
$conf
[
$prefix
.
'db_client_flags'
];
$this
->
dbClientFlags
=
$conf
[
$prefix
.
'db_client_flags'
];
$this
->
_iConnId
=
mysqli_init
();
$this
->
_iConnId
=
mysqli_init
();
$this
->
_iConnId
->
real_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
null
,
(
int
)
$this
->
dbPort
,
null
,
$this
->
dbClientFlags
);
$try
=
0
;
while
(
$this
->
_iConnId
->
connect_error
&&
$try
<
5
)
{
if
(
$try
>
0
)
sleep
(
1
);
$try
++
;
mysqli_real_connect
(
$this
->
_iConnId
,
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
''
,
(
int
)
$this
->
dbPort
,
NULL
,
$this
->
dbClientFlags
);
$this
->
_iConnId
->
real_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
null
,
(
int
)
$this
->
dbPort
,
null
,
$this
->
dbClientFlags
);
for
(
$try
=
0
;(
!
is_object
(
$this
->
_iConnId
)
||
mysqli_connect_error
())
&&
$try
<
5
;
++
$try
)
{
sleep
(
$try
);
mysqli_real_connect
(
$this
->
_iConnId
,
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
''
,
(
int
)
$this
->
dbPort
,
NULL
,
$this
->
dbClientFlags
);
}
}
if
(
$this
->
_iConnId
->
connect_error
)
{
if
(
!
is_object
(
$this
->
_iConnId
)
||
mysqli_
connect_error
()
)
{
$this
->
_iConnId
=
null
;
$this
->
_iConnId
=
null
;
$this
->
_sqlerror
(
'Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'
);
$this
->
_sqlerror
(
'Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'
);
return
false
;
return
false
;
...
@@ -244,7 +241,7 @@ class db {
...
@@ -244,7 +241,7 @@ class db {
$try
++
;
$try
++
;
$ok
=
mysqli_ping
(
$this
->
_iConnId
);
$ok
=
mysqli_ping
(
$this
->
_iConnId
);
if
(
!
$ok
)
{
if
(
!
$ok
)
{
if
(
!
mysqli_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
$this
->
dbName
,
(
int
)
$this
->
dbPort
))
{
if
(
!
mysqli_
real_
connect
(
mysqli_init
(),
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
$this
->
dbName
,
(
int
)
$this
->
dbPort
,
NULL
,
$this
->
dbClientFlags
))
{
if
(
$try
>
4
)
{
if
(
$try
>
4
)
{
$this
->
_sqlerror
(
'DB::query -> reconnect'
);
$this
->
_sqlerror
(
'DB::query -> reconnect'
);
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
server/lib/app.inc.php
100755 → 100644
+
1
−
1
View file @
aa8d9264
...
@@ -51,7 +51,7 @@ class app {
...
@@ -51,7 +51,7 @@ class app {
*/
*/
if
(
$conf
[
'dbmaster_host'
]
!=
''
&&
(
$conf
[
'dbmaster_host'
]
!=
$conf
[
'db_host'
]
||
(
$conf
[
'dbmaster_host'
]
==
$conf
[
'db_host'
]
&&
$conf
[
'dbmaster_database'
]
!=
$conf
[
'db_database'
])))
{
if
(
$conf
[
'dbmaster_host'
]
!=
''
&&
(
$conf
[
'dbmaster_host'
]
!=
$conf
[
'db_host'
]
||
(
$conf
[
'dbmaster_host'
]
==
$conf
[
'db_host'
]
&&
$conf
[
'dbmaster_database'
]
!=
$conf
[
'db_database'
])))
{
$this
->
dbmaster
=
new
db
(
$conf
[
'dbmaster_host'
],
$conf
[
'dbmaster_user'
],
$conf
[
'dbmaster_password'
],
$conf
[
'dbmaster_database'
],
$conf
[
'dbmaster_port'
]);
$this
->
dbmaster
=
new
db
(
$conf
[
'dbmaster_host'
],
$conf
[
'dbmaster_user'
],
$conf
[
'dbmaster_password'
],
$conf
[
'dbmaster_database'
],
$conf
[
'dbmaster_port'
]
,
$conf
[
'dbmaster_client_flags'
]
);
}
else
{
}
else
{
$this
->
dbmaster
=
$this
->
db
;
$this
->
dbmaster
=
$this
->
db
;
}
}
...
...
This diff is collapsed.
Click to expand it.
server/lib/classes/db_mysql.inc.php
+
8
−
11
View file @
aa8d9264
...
@@ -64,7 +64,7 @@ class db
...
@@ -64,7 +64,7 @@ class db
*/
*/
// constructor
// constructor
public
function
__construct
(
$host
=
NULL
,
$user
=
NULL
,
$pass
=
NULL
,
$database
=
NULL
,
$port
=
NULL
)
{
public
function
__construct
(
$host
=
NULL
,
$user
=
NULL
,
$pass
=
NULL
,
$database
=
NULL
,
$port
=
NULL
,
$flags
=
NULL
)
{
global
$app
,
$conf
;
global
$app
,
$conf
;
$this
->
dbHost
=
$host
?
$host
:
$conf
[
'db_host'
];
$this
->
dbHost
=
$host
?
$host
:
$conf
[
'db_host'
];
...
@@ -74,19 +74,16 @@ class db
...
@@ -74,19 +74,16 @@ class db
$this
->
dbPass
=
$pass
?
$pass
:
$conf
[
'db_password'
];
$this
->
dbPass
=
$pass
?
$pass
:
$conf
[
'db_password'
];
$this
->
dbCharset
=
$conf
[
'db_charset'
];
$this
->
dbCharset
=
$conf
[
'db_charset'
];
$this
->
dbNewLink
=
$conf
[
'db_new_link'
];
$this
->
dbNewLink
=
$conf
[
'db_new_link'
];
$this
->
dbClientFlags
=
$conf
[
'db_client_flags'
];
$this
->
dbClientFlags
=
$flags
?
$flags
:
$conf
[
'db_client_flags'
];
$this
->
_iConnId
=
mysqli_init
();
$this
->
_iConnId
=
mysqli_init
();
$this
->
_iConnId
->
real_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
null
,
(
int
)
$this
->
dbPort
,
null
,
$this
->
dbClientFlags
);
$try
=
0
;
while
(
$this
->
_iConnId
->
connect_error
&&
$try
<
5
)
{
if
(
$try
>
0
)
sleep
(
1
);
$try
++
;
mysqli_real_connect
(
$this
->
_iConnId
,
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
''
,
(
int
)
$this
->
dbPort
,
NULL
,
$this
->
dbClientFlags
);
$this
->
_iConnId
->
real_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
null
,
(
int
)
$this
->
dbPort
,
null
,
$this
->
dbClientFlags
);
for
(
$try
=
0
;(
!
is_object
(
$this
->
_iConnId
)
||
mysqli_connect_error
())
&&
$try
<
5
;
++
$try
)
{
sleep
(
$try
);
mysqli_real_connect
(
$this
->
_iConnId
,
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
''
,
(
int
)
$this
->
dbPort
,
NULL
,
$this
->
dbClientFlags
);
}
}
if
(
$this
->
_iConnId
->
connect_error
)
{
if
(
!
is_object
(
$this
->
_iConnId
)
||
mysqli_
connect_error
()
)
{
$this
->
_iConnId
=
null
;
$this
->
_iConnId
=
null
;
$this
->
_sqlerror
(
'Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'
,
''
,
true
);
$this
->
_sqlerror
(
'Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'
,
''
,
true
);
return
false
;
return
false
;
...
@@ -198,7 +195,7 @@ class db
...
@@ -198,7 +195,7 @@ class db
$try
++
;
$try
++
;
$ok
=
mysqli_ping
(
$this
->
_iConnId
);
$ok
=
mysqli_ping
(
$this
->
_iConnId
);
if
(
!
$ok
)
{
if
(
!
$ok
)
{
if
(
!
mysqli_connect
(
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
$this
->
dbName
,
(
int
)
$this
->
dbPort
))
{
if
(
!
mysqli_
real_
connect
(
mysqli_init
(),
$this
->
dbHost
,
$this
->
dbUser
,
$this
->
dbPass
,
$this
->
dbName
,
(
int
)
$this
->
dbPort
,
NULL
,
$this
->
dbClientFlags
))
{
if
(
$this
->
errorNumber
==
'111'
)
{
if
(
$this
->
errorNumber
==
'111'
)
{
// server is not available
// server is not available
if
(
$try
>
9
)
{
if
(
$try
>
9
)
{
...
...
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