Marius Cramer
2015-04-16 305dda7079bbf0bc2904ea526aeea22328146423
- changed some things in mysql lib for installer
4 files modified
34 ■■■■■ changed files
install/install.php 6 ●●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php 4 ●●●● patch | view | raw | blame | history
install/lib/mysql.lib.php 18 ●●●● patch | view | raw | blame | history
install/update.php 6 ●●●●● patch | view | raw | blame | history
install/install.php
@@ -449,10 +449,8 @@
        // 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
@@ -172,7 +172,7 @@
        }
        //* Set the database name in the DB library
        $this->db->dbName = $conf['mysql']['database'];
        $this->db->setDBName($conf['mysql']['database']);
        //* Load the database dump into the database, if database contains no tables
        $db_tables = $this->db->getTables();
@@ -224,7 +224,7 @@
        $this->db->query('FLUSH PRIVILEGES;');
        //* Set the database name in the DB library
        $this->db->dbName = $conf['mysql']['database'];
        $this->db->setDBName($conf['mysql']['database']);
        $tpl_ini_array = ini_to_array(rf('tpl/server.ini.master'));
install/lib/mysql.lib.php
@@ -69,7 +69,7 @@
        
        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 @@
            $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
@@ -267,10 +267,8 @@
    // 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;
}