define MySQL port by its own (rather than in the host with :port); it's simply cleaner
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($config_dir.'/'.$configfile, $content); |
| | | |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | wf("$config_dir/$configfile", $content); |
| | | |
| | | exec("chmod 660 $config_dir/$configfile"); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf("$config_dir/$configfile", $content); |
| | | |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf["mysql"]["host"], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $content); |
| | | $content = str_replace('{server_id}', $conf["server_id"], $content); |
| | | wf($conf["mydns"]["config_dir"].'/'.$configfile, $content); |
| | | exec('chmod 600 '.$conf["mydns"]["config_dir"].'/'.$configfile); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | wf("$config_dir/$configfile", $content); |
| | | |
| | | exec("chmod 660 $config_dir/$configfile"); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf("$config_dir/$configfile", $content); |
| | | |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf["mysql"]["host"], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf["server_id"], $content); |
| | | wf($conf["mydns"]["config_dir"].'/'.$configfile, $content); |
| | | exec('chmod 600 '.$conf["mydns"]["config_dir"].'/'.$configfile); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $finished = false; |
| | | do { |
| | | $tmp_mysql_server_host = $inst->free_query('MySQL server hostname', $conf['mysql']['host'],'mysql_hostname'); |
| | | $tmp_mysql_server_port = $inst->free_query('MySQL server port', $conf['mysql']['port'],'mysql_port'); |
| | | $tmp_mysql_server_admin_user = $inst->free_query('MySQL root username', $conf['mysql']['admin_user'],'mysql_root_user'); |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL root password', $conf['mysql']['admin_password'],'mysql_root_password'); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL database to create', $conf['mysql']['database'],'mysql_database'); |
| | |
| | | } |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password, (int)$tmp_mysql_server_port)) { |
| | | $conf['mysql']['host'] = $tmp_mysql_server_host; |
| | | $conf['mysql']['port'] = $tmp_mysql_server_port; |
| | | $conf['mysql']['admin_user'] = $tmp_mysql_server_admin_user; |
| | | $conf['mysql']['admin_password'] = $tmp_mysql_server_admin_password; |
| | | $conf['mysql']['database'] = $tmp_mysql_server_database; |
| | |
| | | $finished = false; |
| | | do { |
| | | $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host'],'mysql_master_hostname'); |
| | | $tmp_mysql_server_port = $inst->free_query('MySQL master server port', $conf['mysql']['master_port'],'mysql_master_port'); |
| | | $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user'],'mysql_master_root_user'); |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password'],'mysql_master_root_password'); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database'],'mysql_master_database'); |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password, (int)$tmp_mysql_server_port)) { |
| | | $conf['mysql']['master_host'] = $tmp_mysql_server_host; |
| | | $conf['mysql']['master_port'] = $tmp_mysql_server_port; |
| | | $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; |
| | | $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; |
| | | $conf['mysql']['master_database'] = $tmp_mysql_server_database; |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | wf($config_dir.'/'.$configfile, $content); |
| | | |
| | | chmod($config_dir.'/'.$configfile, 0660); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($config_dir.'/'.$configfile, $content); |
| | | |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | wf($conf['mydns']['config_dir'].'/'.$configfile, $content); |
| | | chmod($conf['mydns']['config_dir'].'/'.$configfile, 0600); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{powerdns_database}', $conf['powerdns']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | wf($conf['powerdns']['config_dir'].'/'.$configfile, $content); |
| | | chmod($conf['powerdns']['config_dir'].'/'.$configfile, 0600); |
| | | chown($conf['powerdns']['config_dir'].'/'.$configfile, 'root'); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content); |
| | | $content = str_replace('{mysql_server_host}', $conf['mysql']['host'], $content); |
| | | $content = str_replace('{mysql_server_port}', $conf['mysql']['port'], $content); |
| | | |
| | | $content = str_replace('{mysql_master_server_ispconfig_user}', $conf['mysql']['master_ispconfig_user'], $content); |
| | | $content = str_replace('{mysql_master_server_ispconfig_password}', $conf['mysql']['master_ispconfig_password'], $content); |
| | | $content = str_replace('{mysql_master_server_database}', $conf['mysql']['master_database'], $content); |
| | | $content = str_replace('{mysql_master_server_host}', $conf['mysql']['master_host'], $content); |
| | | $content = str_replace('{mysql_master_server_port}', $conf['mysql']['master_port'], $content); |
| | | |
| | | $content = str_replace('{server_id}', $conf['server_id'], $content); |
| | | $content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content); |
| | |
| | | $tContents = str_replace('{mysql_server_database}', $conf["mysql"]["database"], $tContents); |
| | | $tContents = str_replace('{mysql_server_ip}', $conf["mysql"]["ip"], $tContents); |
| | | $tContents = str_replace('{mysql_server_host}', $conf['mysql']['host'], $tContents); |
| | | $tContents = str_replace('{mysql_server_port}', $conf['mysql']['port'], $tContents); |
| | | $tContents = str_replace('{mysql_server_port}', $conf["mysql"]["port"], $tContents); |
| | | |
| | | return $tContents; |
| | |
| | | MYSQL_SERVER {mysql_server_host} |
| | | MYSQL_PORT {mysql_server_port} |
| | | MYSQL_USERNAME {mysql_server_ispconfig_user} |
| | | MYSQL_PASSWORD {mysql_server_ispconfig_password} |
| | | MYSQL_PORT 0 |
| | |
| | | //** Database |
| | | $conf['db_type'] = 'mysql'; |
| | | $conf['db_host'] = '{mysql_server_host}'; |
| | | $conf['db_port'] = '{mysql_server_port}'; |
| | | $conf['db_database'] = '{mysql_server_database}'; |
| | | $conf['db_user'] = '{mysql_server_ispconfig_user}'; |
| | | $conf['db_password'] = '{mysql_server_ispconfig_password}'; |
| | |
| | | |
| | | define('DB_TYPE',$conf['db_type']); |
| | | define('DB_HOST',$conf['db_host']); |
| | | define('DB_PORT',$conf['db_port']); |
| | | define('DB_DATABASE',$conf['db_database']); |
| | | define('DB_USER',$conf['db_user']); |
| | | define('DB_PASSWORD',$conf['db_password']); |
| | |
| | | //** Database settings for the master DB. This setting is only used in multiserver setups |
| | | $conf['dbmaster_type'] = 'mysql'; |
| | | $conf['dbmaster_host'] = '{mysql_master_server_host}'; |
| | | $conf['dbmaster_host'] = '{mysql_master_server_port}'; |
| | | $conf['dbmaster_database'] = '{mysql_master_server_database}'; |
| | | $conf['dbmaster_user'] = '{mysql_master_server_ispconfig_user}'; |
| | | $conf['dbmaster_password'] = '{mysql_master_server_ispconfig_password}'; |
| | |
| | | # ); |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | # password-query with prefetch |
| | |
| | | #password_query = SELECT userid as user, password, home as userdb_home, uid as userdb_uid, gid as userdb_gid FROM users WHERE userid = '%u' |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | # password-query with prefetch |
| | |
| | | # FROM users WHERE userid = '%u' |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | # password-query with prefetch |
| | |
| | | db-user = {mysql_server_ispconfig_user} # SQL server username |
| | | db-password = {mysql_server_ispconfig_password} # SQL server password |
| | | database = {mysql_server_database} # MyDNS database name |
| | | db-port = {mysql_server_port} # SQL server port |
| | | |
| | | |
| | | # GENERAL OPTIONS |
| | |
| | | # FROM users WHERE userid = '%u' |
| | | |
| | | driver = mysql |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} |
| | | connect = host={mysql_server_host} dbname={mysql_server_database} user={mysql_server_ispconfig_user} password={mysql_server_ispconfig_password} port={mysql_server_port} |
| | | default_pass_scheme = CRYPT |
| | | |
| | | # password-query with prefetch |
| | |
| | | gmysql-user={mysql_server_ispconfig_user} |
| | | gmysql-password={mysql_server_ispconfig_password} |
| | | gmysql-dbname={powerdns_database} |
| | | gmysql-port={mysql_server_port} |
| | | |
| | | slave=yes |
| | | master=yes |
| | |
| | | $finished = false; |
| | | do { |
| | | $tmp_mysql_server_host = $inst->free_query('MySQL master server hostname', $conf['mysql']['master_host'],'mysql_master_hostname'); |
| | | $tmp_mysql_server_port = $inst->free_query('MySQL master server port', $conf['mysql']['master_port'],'mysql_master_port'); |
| | | $tmp_mysql_server_admin_user = $inst->free_query('MySQL master server root username', $conf['mysql']['master_admin_user'],'mysql_master_root_user'); |
| | | $tmp_mysql_server_admin_password = $inst->free_query('MySQL master server root password', $conf['mysql']['master_admin_password'],'mysql_master_root_password'); |
| | | $tmp_mysql_server_database = $inst->free_query('MySQL master server database name', $conf['mysql']['master_database'],'mysql_master_database'); |
| | | |
| | | //* Initialize the MySQL server connection |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password)) { |
| | | if(@mysql_connect($tmp_mysql_server_host, $tmp_mysql_server_admin_user, $tmp_mysql_server_admin_password, (int)$tmp_mysql_server_port)) { |
| | | $conf['mysql']['master_host'] = $tmp_mysql_server_host; |
| | | $conf['mysql']['master_port'] = $tmp_mysql_server_port; |
| | | $conf['mysql']['master_admin_user'] = $tmp_mysql_server_admin_user; |
| | | $conf['mysql']['master_admin_password'] = $tmp_mysql_server_admin_password; |
| | | $conf['mysql']['master_database'] = $tmp_mysql_server_database; |
| | |
| | | private $_iConnId; |
| | | |
| | | private $dbHost = ''; // hostname of the MySQL server |
| | | private $dbPort = ''; // port of the MySQL server |
| | | private $dbName = ''; // logical database name on that server |
| | | private $dbUser = ''; // database authorized user |
| | | private $dbPass = ''; // user's password |
| | |
| | | global $conf; |
| | | if($prefix != '') $prefix .= '_'; |
| | | $this->dbHost = $conf[$prefix.'db_host']; |
| | | $this->dbPort = $conf[$prefix.'db_port']; |
| | | $this->dbName = $conf[$prefix.'db_database']; |
| | | $this->dbUser = $conf[$prefix.'db_user']; |
| | | $this->dbPass = $conf[$prefix.'db_password']; |
| | |
| | | $this->dbNewLink = $conf[$prefix.'db_new_link']; |
| | | $this->dbClientFlags = $conf[$prefix.'db_client_flags']; |
| | | |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, (int)$this->dbPort); |
| | | $try = 0; |
| | | while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) { |
| | | if($try > 0) sleep(1); |
| | | |
| | | $try++; |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, (int)$this->dbPort); |
| | | } |
| | | |
| | | if(!is_object($this->_iConnId) || mysqli_connect_error()) { |
| | |
| | | $try++; |
| | | $ok = mysqli_ping($this->_iConnId); |
| | | if(!$ok) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName)) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName, (int)$this->dbPort)) { |
| | | if($try > 4) { |
| | | $this->_sqlerror('DB::query -> reconnect'); |
| | | return false; |
| | |
| | | //** Database |
| | | $conf['db_type'] = 'mysql'; |
| | | $conf['db_host'] = 'localhost'; |
| | | $conf['db_port'] = 3306; |
| | | $conf['db_database'] = 'ispconfig3_305'; |
| | | $conf['db_user'] = 'root'; |
| | | $conf['db_password'] = ''; |
| | |
| | | |
| | | define('DB_TYPE', $conf['db_type']); |
| | | define('DB_HOST', $conf['db_host']); |
| | | define('DB_PORT', $conf['db_port']); |
| | | define('DB_DATABASE', $conf['db_database']); |
| | | define('DB_USER', $conf['db_user']); |
| | | define('DB_PASSWORD', $conf['db_password']); |
| | |
| | | //** Database settings for the master DB. This setting is only used in multiserver setups |
| | | $conf['dbmaster_type'] = 'mysql'; |
| | | $conf['dbmaster_host'] = '{mysql_master_server_host}'; |
| | | $conf['dbmaster_port'] = '{mysql_master_server_port}'; |
| | | $conf['dbmaster_database'] = '{mysql_master_server_database}'; |
| | | $conf['dbmaster_user'] = '{mysql_master_server_ispconfig_user}'; |
| | | $conf['dbmaster_password'] = '{mysql_master_server_ispconfig_password}'; |
| | |
| | | */ |
| | | |
| | | 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']); |
| | | $this->dbmaster = new db($conf['dbmaster_host'], $conf['dbmaster_user'], $conf['dbmaster_password'], $conf['dbmaster_database'], $conf['dbmaster_port']); |
| | | } else { |
| | | $this->dbmaster = $this->db; |
| | | } |
| | |
| | | private $_iConnId; |
| | | |
| | | private $dbHost = ''; // hostname of the MySQL server |
| | | private $dbPort = ''; // port of the MySQL server |
| | | private $dbName = ''; // logical database name on that server |
| | | private $dbUser = ''; // database authorized user |
| | | private $dbPass = ''; // user's password |
| | |
| | | */ |
| | | |
| | | // constructor |
| | | public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL) { |
| | | public function __construct($host = NULL , $user = NULL, $pass = NULL, $database = NULL, $port = NULL) { |
| | | global $app, $conf; |
| | | |
| | | $this->dbHost = $host ? $host : $conf['db_host']; |
| | | $this->dbPort = $port ? $port : $conf['db_port']; |
| | | $this->dbName = $database ? $database : $conf['db_database']; |
| | | $this->dbUser = $user ? $user : $conf['db_user']; |
| | | $this->dbPass = $pass ? $pass : $conf['db_password']; |
| | |
| | | $this->dbNewLink = $conf['db_new_link']; |
| | | $this->dbClientFlags = $conf['db_client_flags']; |
| | | |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, (int)$this->dbPort); |
| | | $try = 0; |
| | | while((!is_object($this->_iConnId) || mysqli_connect_error()) && $try < 5) { |
| | | if($try > 0) sleep(1); |
| | | |
| | | $try++; |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass); |
| | | $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, (int)$this->dbPort); |
| | | } |
| | | |
| | | if(!is_object($this->_iConnId) || mysqli_connect_error()) { |
| | |
| | | $try++; |
| | | $ok = mysqli_ping($this->_iConnId); |
| | | if(!$ok) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName)) { |
| | | if(!mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName, (int)$this->dbPort)) { |
| | | if($this->errorNumber == '111') { |
| | | // server is not available |
| | | if($try > 9) { |