Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISPConfig
ISPConfig 3
Commits
305dda70
Commit
305dda70
authored
Apr 16, 2015
by
Marius Cramer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- changed some things in mysql lib for installer
parent
64060a4c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
13 deletions
+21
-13
install/install.php
install/install.php
+2
-4
install/lib/installer_base.lib.php
install/lib/installer_base.lib.php
+2
-2
install/lib/mysql.lib.php
install/lib/mysql.lib.php
+15
-3
install/update.php
install/update.php
+2
-4
No files found.
install/install.php
View file @
305dda70
...
...
@@ -449,10 +449,8 @@ if($install_mode == 'standard') {
// initialize the connection to the master database
$inst
->
dbmaster
=
new
db
();
if
(
$inst
->
dbmaster
->
linkId
)
$inst
->
dbmaster
->
closeConn
();
$inst
->
dbmaster
->
dbHost
=
$conf
[
'mysql'
][
"master_host"
];
$inst
->
dbmaster
->
dbName
=
$conf
[
'mysql'
][
"master_database"
];
$inst
->
dbmaster
->
dbUser
=
$conf
[
'mysql'
][
"master_admin_user"
];
$inst
->
dbmaster
->
dbPass
=
$conf
[
'mysql'
][
"master_admin_password"
];
$inst
->
dbmaster
->
setDBData
(
$conf
[
'mysql'
][
"master_host"
],
$conf
[
'mysql'
][
"master_admin_user"
],
$conf
[
'mysql'
][
"master_admin_password"
]);
$inst
->
dbmaster
->
setDBName
(
$conf
[
'mysql'
][
"master_database"
]);
}
else
{
// the master DB is the same then the slave DB
...
...
install/lib/installer_base.lib.php
View file @
305dda70
...
...
@@ -172,7 +172,7 @@ class installer_base {
}
//* Set the database name in the DB library
$this
->
db
->
db
Name
=
$conf
[
'mysql'
][
'database'
];
$this
->
db
->
setDB
Name
(
$conf
[
'mysql'
][
'database'
]
)
;
//* Load the database dump into the database, if database contains no tables
$db_tables
=
$this
->
db
->
getTables
();
...
...
@@ -224,7 +224,7 @@ class installer_base {
$this
->
db
->
query
(
'FLUSH PRIVILEGES;'
);
//* Set the database name in the DB library
$this
->
db
->
db
Name
=
$conf
[
'mysql'
][
'database'
];
$this
->
db
->
setDB
Name
(
$conf
[
'mysql'
][
'database'
]
)
;
$tpl_ini_array
=
ini_to_array
(
rf
(
'tpl/server.ini.master'
));
...
...
install/lib/mysql.lib.php
View file @
305dda70
...
...
@@ -69,7 +69,7 @@ class db extends mysqli
if
(
$this
->
_iConnId
)
return
true
;
$this
->
dbHost
=
$conf
[
"mysql"
][
"host"
];
$this
->
dbName
=
$conf
[
"mysql"
][
"database"
];
$this
->
dbName
=
false
;
//
$conf["mysql"]["database"];
$this
->
dbUser
=
$conf
[
"mysql"
][
"admin_user"
];
$this
->
dbPass
=
$conf
[
"mysql"
][
"admin_password"
];
$this
->
dbCharset
=
$conf
[
"mysql"
][
"charset"
];
...
...
@@ -90,13 +90,25 @@ class db extends mysqli
$this
->
_sqlerror
(
'Zugriff auf Datenbankserver fehlgeschlagen! / Database server not accessible!'
);
return
false
;
}
if
(
$this
->
dbName
)
$this
->
setDBName
(
$this
->
dbName
);
$this
->
_setCharset
();
}
public
function
setDBData
(
$host
,
$user
,
$password
)
{
$this
->
dbHost
=
$host
;
$this
->
dbUser
=
$user
;
$this
->
dbPass
=
$password
;
}
public
function
setDBName
(
$name
)
{
$this
->
dbName
=
$name
;
if
(
!
((
bool
)
mysqli_query
(
$this
->
_iConnId
,
'USE `'
.
$this
->
dbName
.
'`'
)))
{
$this
->
close
();
$this
->
_sqlerror
(
'Datenbank nicht gefunden / Database not found'
);
return
false
;
}
$this
->
_setCharset
();
}
public
function
close
()
{
...
...
install/update.php
View file @
305dda70
...
...
@@ -267,10 +267,8 @@ if($conf['mysql']['master_slave_setup'] == 'y') {
// initialize the connection to the master database
$inst
->
dbmaster
=
new
db
();
if
(
$inst
->
dbmaster
->
linkId
)
$inst
->
dbmaster
->
closeConn
();
$inst
->
dbmaster
->
dbHost
=
$conf
[
'mysql'
][
"master_host"
];
$inst
->
dbmaster
->
dbName
=
$conf
[
'mysql'
][
"master_database"
];
$inst
->
dbmaster
->
dbUser
=
$conf
[
'mysql'
][
"master_admin_user"
];
$inst
->
dbmaster
->
dbPass
=
$conf
[
'mysql'
][
"master_admin_password"
];
$inst
->
dbmaster
->
setDBData
(
$conf
[
'mysql'
][
"master_host"
],
$conf
[
'mysql'
][
"master_admin_user"
],
$conf
[
'mysql'
][
"master_admin_password"
]);
$inst
->
dbmaster
->
setDBName
(
$conf
[
'mysql'
][
"master_database"
]);
}
else
{
$inst
->
dbmaster
=
$inst
->
db
;
}
...
...
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