New: Can use databases on a different port than default
This commit is contained in:
parent
6f881fdd2d
commit
f8888c6454
@ -1398,7 +1398,7 @@ class Adherent extends CommonObject
|
||||
$htpass=crypt($this->pass,makesalt());
|
||||
$query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->prenom." ".$this->nom."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")";
|
||||
// $mydb=new Db('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT);
|
||||
$result = $mydb->query($query);
|
||||
|
||||
if ($result)
|
||||
@ -1426,7 +1426,7 @@ class Adherent extends CommonObject
|
||||
defined('ADHERENT_SPIP_DB') && ADHERENT_SPIP_DB != ''
|
||||
){
|
||||
$query = "DELETE FROM spip_auteurs WHERE login='".$this->login."'";
|
||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT);
|
||||
$result = $mydb->query($query);
|
||||
|
||||
if ($result)
|
||||
@ -1456,7 +1456,7 @@ class Adherent extends CommonObject
|
||||
{
|
||||
|
||||
$query = "SELECT login FROM spip_auteurs WHERE login='".$this->login."'";
|
||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB);
|
||||
$mydb=new DoliDb('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT);
|
||||
|
||||
if ($mydb->ok) {
|
||||
|
||||
|
||||
@ -74,11 +74,12 @@ elseif ($_POST["test"])
|
||||
// Test de la connexion a la database webcalendar
|
||||
$conf->oscommerce->db->type=$dolibarr_main_db_type;
|
||||
$conf->oscommerce->db->host=$_POST["oscommerce_dbhost"];
|
||||
$conf->oscommerce->db->port=$_POST["oscommerce_dbport"];
|
||||
$conf->oscommerce->db->name=$_POST["oscommerce_dbname"];
|
||||
$conf->oscommerce->db->user=$_POST["oscommerce_dbuser"];
|
||||
$conf->oscommerce->db->pass=$_POST["oscommerce_dbpass"];
|
||||
|
||||
$oscommercedb=new DoliDB($conf->oscommerce->db->type,$conf->oscommerce->db->host,$conf->oscommerce->db->user,$conf->oscommerce->db->pass,$conf->oscommerce->db->name);
|
||||
$oscommercedb=new DoliDB($conf->oscommerce->db->type,$conf->oscommerce->db->host,$conf->oscommerce->db->user,$conf->oscommerce->db->pass,$conf->oscommerce->db->name,$conf->oscommerce->db->port);
|
||||
|
||||
//print "D ".$db." - ".$db->db."<br>\n";
|
||||
//print "W ".$oscommercedb." - ".$oscommercedb->db."<br>\n";
|
||||
|
||||
@ -78,6 +78,7 @@ elseif ($actiontest)
|
||||
// Test de la connexion a la database mantis
|
||||
$conf->mantis->db->type=$dolibarr_main_db_type;
|
||||
$conf->mantis->db->host=$_POST["phpmantis_host"];
|
||||
$conf->mantis->db->port=$_POST["phpmantis_port"];
|
||||
$conf->mantis->db->user=$_POST["phpmantis_user"];
|
||||
$conf->mantis->db->pass=$_POST["phpmantis_pass"];
|
||||
$conf->mantis->db->name=$_POST["phpmantis_dbname"];
|
||||
|
||||
@ -81,6 +81,7 @@ elseif ($actiontest)
|
||||
// Test de la connexion a la database phenix
|
||||
$conf->phenix->db->type=$dolibarr_main_db_type;
|
||||
$conf->phenix->db->host=$_POST["phpphenix_host"];
|
||||
$conf->phenix->db->port=$_POST["phpphenix_port"];
|
||||
$conf->phenix->db->user=$_POST["phpphenix_user"];
|
||||
$conf->phenix->db->pass=$_POST["phpphenix_pass"];
|
||||
$conf->phenix->db->name=$_POST["phpphenix_dbname"];
|
||||
|
||||
@ -102,6 +102,7 @@ $configfileparameters=array(
|
||||
'dolibarr_main_data_root',
|
||||
'separator',
|
||||
'dolibarr_main_db_host',
|
||||
'dolibarr_main_db_port',
|
||||
'dolibarr_main_db_name',
|
||||
'dolibarr_main_db_type',
|
||||
'dolibarr_main_db_user',
|
||||
@ -133,6 +134,7 @@ $configfilelib=array(
|
||||
$langs->trans("DataRootServer"),
|
||||
'separator',
|
||||
$langs->trans("DatabaseServer"),
|
||||
$langs->trans("DatabasePort"),
|
||||
$langs->trans("DatabaseName"),
|
||||
$langs->trans("DriverType"),
|
||||
$langs->trans("User"),
|
||||
|
||||
@ -83,6 +83,7 @@ elseif ($actiontest)
|
||||
// Test de la connexion a la database webcalendar
|
||||
$conf->webcal->db->type=$dolibarr_main_db_type;
|
||||
$conf->webcal->db->host=$_POST["phpwebcalendar_host"];
|
||||
$conf->webcal->db->port=$_POST["phpwebcalendar_port"];
|
||||
$conf->webcal->db->user=$_POST["phpwebcalendar_user"];
|
||||
$conf->webcal->db->pass=$_POST["phpwebcalendar_pass"];
|
||||
$conf->webcal->db->name=$_POST["phpwebcalendar_dbname"];
|
||||
|
||||
@ -14,14 +14,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/boutique/osc_master.inc.php
|
||||
\brief Fichier de preparation de l'environnement Dolibarr pour OSCommerce
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php");
|
||||
@ -29,7 +27,7 @@ require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php");
|
||||
/*
|
||||
* Creation objet $dbosc
|
||||
*/
|
||||
$dbosc = new DoliDb($conf->db->type,$conf->global->OSC_DB_HOST,$conf->global->OSC_DB_USER,$conf->global->OSC_DB_PASS,$conf->global->OSC_DB_NAME);
|
||||
$dbosc = new DoliDb($conf->db->type,$conf->global->OSC_DB_HOST,$conf->global->OSC_DB_USER,$conf->global->OSC_DB_PASS,$conf->global->OSC_DB_NAME,$conf->global->OSC_DB_PORT);
|
||||
if (! $dbosc->connected)
|
||||
{
|
||||
dolibarr_syslog($dbosc,"host=".$conf->global->OSC_DB_HOST.", user=".$conf->global->OSC_DB_USER.", databasename=".$conf->global->OSC_DB_NAME.", ".$db->error,LOG_ERR);
|
||||
|
||||
@ -276,6 +276,7 @@ class Conf
|
||||
$this->webcal->enabled=defined('MAIN_MODULE_WEBCALENDAR')?MAIN_MODULE_WEBCALENDAR:0;
|
||||
$this->webcal->db->type=defined('PHPWEBCALENDAR_TYPE')?PHPWEBCALENDAR_TYPE:'__dolibarr_main_db_type__';
|
||||
$this->webcal->db->host=defined('PHPWEBCALENDAR_HOST')?PHPWEBCALENDAR_HOST:'';
|
||||
$this->webcal->db->port=defined('PHPWEBCALENDAR_PORT')?PHPWEBCALENDAR_PORT:'';
|
||||
$this->webcal->db->user=defined('PHPWEBCALENDAR_USER')?PHPWEBCALENDAR_USER:'';
|
||||
$this->webcal->db->pass=defined('PHPWEBCALENDAR_PASS')?PHPWEBCALENDAR_PASS:'';
|
||||
$this->webcal->db->name=defined('PHPWEBCALENDAR_DBNAME')?PHPWEBCALENDAR_DBNAME:'';
|
||||
@ -284,6 +285,7 @@ class Conf
|
||||
$this->phenix->enabled=defined('MAIN_MODULE_PHENIX')?MAIN_MODULE_PHENIX:0;
|
||||
$this->phenix->db->type=defined('PHPPHENIX_TYPE')?PHPPHENIX_TYPE:'__dolibarr_main_db_type__';
|
||||
$this->phenix->db->host=defined('PHPPHENIX_HOST')?PHPPHENIX_HOST:'';
|
||||
$this->phenix->db->port=defined('PHPPHENIX_PORT')?PHPPHENIX_PORT:'';
|
||||
$this->phenix->db->user=defined('PHPPHENIX_USER')?PHPPHENIX_USER:'';
|
||||
$this->phenix->db->pass=defined('PHPPHENIX_PASS')?PHPPHENIX_PASS:'';
|
||||
$this->phenix->db->name=defined('PHPPHENIX_DBNAME')?PHPPHENIX_DBNAME:'';
|
||||
@ -292,6 +294,7 @@ class Conf
|
||||
$this->mantis->enabled=defined('MAIN_MODULE_MANTIS')?MAIN_MODULE_MANTIS:0;
|
||||
$this->mantis->db->type=defined('PHPMANTIS_TYPE')?PHPMANTIS_TYPE:'__dolibarr_main_db_type__';
|
||||
$this->mantis->db->host=defined('PHPMANTIS_HOST')?PHPMANTIS_HOST:'';
|
||||
$this->mantis->db->port=defined('PHPMANTIS_PORT')?PHPMANTIS_PORT:'';
|
||||
$this->mantis->db->user=defined('PHPMANTIS_USER')?PHPMANTIS_USER:'';
|
||||
$this->mantis->db->pass=defined('PHPMANTIS_PASS')?PHPMANTIS_PASS:'';
|
||||
$this->mantis->db->name=defined('PHPMANTIS_DBNAME')?PHPMANTIS_DBNAME:'';
|
||||
|
||||
@ -52,6 +52,15 @@ $dolibarr_main_data_root="";
|
||||
$dolibarr_main_db_host="";
|
||||
|
||||
|
||||
# dolibarr_main_db_port
|
||||
# This parameter contains the port of the Dolibarr database.
|
||||
# Default value: none
|
||||
# Examples:
|
||||
# $dolibarr_main_db_host="3306;
|
||||
#
|
||||
$dolibarr_main_db_port="";
|
||||
|
||||
|
||||
# dolibarr_main_db_name
|
||||
# This parameter contains name of Dolibarr database.
|
||||
# Examples:
|
||||
|
||||
@ -15,14 +15,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/install/etape0.php
|
||||
\brief Permet d'afficher et de confirmer le charset par rapport aux informations précédentes -> sélection suite à connexion'
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
define('DONOTLOADCONF',1); // To avoid loading conf by file inc.php
|
||||
@ -110,11 +108,11 @@ if (! $error)
|
||||
{
|
||||
$databasefortest='mssql';
|
||||
}
|
||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest);
|
||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$userroot,$passroot,$databasefortest,$_POST["db_port"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$_POST["db_user"],$_POST["db_pass"],$_POST["db_name"]);
|
||||
$db = new DoliDb($_POST["db_type"],$_POST["db_host"],$_POST["db_user"],$_POST["db_pass"],$_POST["db_name"],$_POST["db_port"]);
|
||||
}
|
||||
if ($db->error)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
*
|
||||
@ -17,14 +17,12 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/install/etape1.php
|
||||
\brief Génère le fichier conf.php avec les informations issues de l'étape précédente
|
||||
\version $Revision$
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
define('DONOTLOADCONF',1); // To avoid loading conf by file inc..php
|
||||
@ -123,6 +121,9 @@ if ($_POST["action"] == "set")
|
||||
fputs($fp, '$dolibarr_main_db_host="'.$_POST["db_host"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
fputs($fp, '$dolibarr_main_db_port="'.$_POST["db_port"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
fputs($fp, '$dolibarr_main_db_name="'.$_POST["db_name"].'";');
|
||||
fputs($fp,"\n");
|
||||
|
||||
@ -292,7 +293,7 @@ if ($_POST["action"] == "set")
|
||||
|
||||
// Creation handler de base, verification du support et connexion
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,$databasefortest,$conf->db->port);
|
||||
if ($db->error)
|
||||
{
|
||||
print '<div class="error">'.$db->error.'</div>';
|
||||
@ -368,7 +369,7 @@ if ($_POST["action"] == "set")
|
||||
{
|
||||
dolibarr_install_syslog("etape1: Creation de la base : ".$dolibarr_main_db_name);
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$userroot,$passroot,'',$conf->db->port);
|
||||
|
||||
if ($db->connected)
|
||||
{
|
||||
@ -426,8 +427,8 @@ if ($_POST["action"] == "set")
|
||||
*/
|
||||
if (! $error)
|
||||
{
|
||||
dolibarr_install_syslog("etape1: connexion de type=".$conf->db->type." sur host=".$conf->db->host." user=".$conf->db->user." name=".$conf->db->name);
|
||||
//print "connexion de type=".$conf->db->type." sur host=".$conf->db->host." user=".$conf->db->user." name=".$conf->db->name;
|
||||
dolibarr_install_syslog("etape1: connexion de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name);
|
||||
//print "connexion de type=".$conf->db->type." sur host=".$conf->db->host." port=".$conf->db->port." user=".$conf->db->user." name=".$conf->db->name;
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ if ($_POST["action"] == "set")
|
||||
print '<table cellspacing="0" cellpadding="4" border="0" width="100%">';
|
||||
$error=0;
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
if ($db->connected == 1)
|
||||
{
|
||||
print "<tr><td>";
|
||||
|
||||
@ -54,11 +54,12 @@ $err=0;
|
||||
$conf = new Conf();
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
$ok = 0;
|
||||
if ($db->ok == 1)
|
||||
{
|
||||
|
||||
@ -77,11 +77,12 @@ if ($_POST["action"] == "set" || $_POST["action"] == "upgrade")
|
||||
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
$ok = 0;
|
||||
|
||||
// Active module user
|
||||
|
||||
@ -192,16 +192,6 @@ while (($file = readdir($handle))!==false)
|
||||
if (is_readable($dir."/".$file) && eregi('^(.*)\.lib\.php',$file,$reg))
|
||||
{
|
||||
$type=$reg[1];
|
||||
$modName = 'DoliDb';
|
||||
|
||||
# print "file=$file type=$type modName=$modName<br>\n";
|
||||
|
||||
# include_once($dir."/".$file);
|
||||
# $objMod = new $modName();
|
||||
# if ($objMod)
|
||||
# {
|
||||
|
||||
# }
|
||||
|
||||
// Version min de la base
|
||||
$versionbasemin=array();
|
||||
@ -258,6 +248,19 @@ while (($file = readdir($handle))!==false)
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top" class="label"><b>
|
||||
<?php echo $langs->trans("Port"); ?>
|
||||
</b></td>
|
||||
<td valign="top" class="label"><input type="text" name="db_port" value="<?php print (isset($dolibarr_main_db_port) && $dolibarr_main_db_port)?$dolibarr_main_db_port:''; ?>">
|
||||
<input type="hidden" name="base" value="">
|
||||
</td>
|
||||
<td class="comment">
|
||||
<?php echo $langs->trans("ServerPortDescription"); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="label" valign="top"><b>
|
||||
<?php echo $langs->trans("DatabaseName"); ?>
|
||||
|
||||
@ -163,6 +163,7 @@ function conf($dolibarr_main_document_root)
|
||||
global $conf;
|
||||
global $dolibarr_main_db_type;
|
||||
global $dolibarr_main_db_host;
|
||||
global $dolibarr_main_db_port;
|
||||
global $dolibarr_main_db_name;
|
||||
global $dolibarr_main_db_user;
|
||||
global $dolibarr_main_db_pass;
|
||||
@ -173,6 +174,7 @@ function conf($dolibarr_main_document_root)
|
||||
$conf=new Conf();
|
||||
$conf->db->type = trim($dolibarr_main_db_type);
|
||||
$conf->db->host = trim($dolibarr_main_db_host);
|
||||
$conf->db->port = trim($dolibarr_main_db_port);
|
||||
$conf->db->name = trim($dolibarr_main_db_name);
|
||||
$conf->db->user = trim($dolibarr_main_db_user);
|
||||
$conf->db->pass = trim($dolibarr_main_db_pass);
|
||||
|
||||
@ -83,11 +83,12 @@ if (! isset($_GET["action"]) || $_GET["action"] == "upgrade")
|
||||
// $conf is already instancied inside inc.php
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
if ($db->connected == 1)
|
||||
{
|
||||
print "<tr><td nowrap>";
|
||||
|
||||
@ -80,6 +80,7 @@ if (isset($_POST['action']) && $_POST['action'] == 'upgrade')
|
||||
// $conf is already instancied inside inc.php
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
|
||||
@ -37,6 +37,7 @@ DatabaseType=Database type
|
||||
DriverType=Driver type
|
||||
Server=Server
|
||||
ServerAddressDescription=Name or ip address for database server, usually 'localhost' when database server is hosted on same server than web server
|
||||
ServerPortDescription=Database server port. Keep empty if unknown.
|
||||
DatabaseServer=Database server
|
||||
DatabaseName=Database name
|
||||
Login=Login
|
||||
|
||||
@ -39,6 +39,7 @@ DatabaseType=Type de la base de donn
|
||||
DriverType=Type du driver
|
||||
Server=Serveur
|
||||
ServerAddressDescription=Nom ou adresse ip du serveur de base de données, généralement 'localhost' quand le serveur est installé sur la même machine que le serveur web
|
||||
ServerPortDescription=Port du serveur. Ne rien mettre si inconnu.
|
||||
DatabaseServer=Serveur de la base de données
|
||||
DatabaseName=Nom de la base de données
|
||||
Login=Login
|
||||
|
||||
@ -107,10 +107,10 @@ class DoliDb
|
||||
\param user Nom de l'utilisateur autorisé
|
||||
\param pass Mot de passe
|
||||
\param name Nom de la database
|
||||
\param newlink ???
|
||||
\param port Port of database server
|
||||
\return int 1 en cas de succès, 0 sinon
|
||||
*/
|
||||
function DoliDb($type='mssql', $host, $user, $pass, $name='', $newlink=0)
|
||||
function DoliDb($type='mssql', $host, $user, $pass, $name='', $port=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -136,7 +136,7 @@ class DoliDb
|
||||
}
|
||||
|
||||
// Essai connexion serveur
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $newlink);
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $port);
|
||||
if ($this->db)
|
||||
{
|
||||
// Si client connecté avec charset different de celui de la base Dolibarr
|
||||
@ -196,13 +196,16 @@ class DoliDb
|
||||
\param login nom de l'utilisateur autoris
|
||||
\param passwd mot de passe
|
||||
\param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
|
||||
\param port Port of database server
|
||||
\return resource handler d'accès à la base
|
||||
\seealso close
|
||||
*/
|
||||
function connect($host, $login, $passwd, $name)
|
||||
function connect($host, $login, $passwd, $name, $port=0)
|
||||
{
|
||||
dolibarr_syslog("DoliDB::connect host=$host, login=$login, passwd=--hidden--, name=$name");
|
||||
$this->db = @mssql_connect($host, $login, $passwd);
|
||||
dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name");
|
||||
$newhost=$host;
|
||||
if ($port) $newhost.=':'.$port;
|
||||
$this->db = @mssql_connect($newhost, $login, $passwd);
|
||||
//force les enregistrement en latin1 si la base est en utf8 par défaut
|
||||
// Supprimé car plante sur mon PHP-Mysql. De plus, la base est forcement en latin1 avec
|
||||
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
||||
|
||||
@ -108,10 +108,10 @@ class DoliDb
|
||||
\param user Nom de l'utilisateur autorisé
|
||||
\param pass Mot de passe
|
||||
\param name Nom de la database
|
||||
\param newlink ???
|
||||
\param port Port of database server
|
||||
\return int 1 en cas de succès, 0 sinon
|
||||
*/
|
||||
function DoliDb($type='mysql', $host, $user, $pass, $name='', $newlink=0)
|
||||
function DoliDb($type='mysql', $host, $user, $pass, $name='', $port=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -156,7 +156,7 @@ class DoliDb
|
||||
}
|
||||
|
||||
// Essai connexion serveur
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $newlink);
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $port);
|
||||
if ($this->db)
|
||||
{
|
||||
$this->connected = 1;
|
||||
@ -223,13 +223,16 @@ class DoliDb
|
||||
\param login nom de l'utilisateur autoris
|
||||
\param passwd mot de passe
|
||||
\param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
|
||||
\return resource handler d'accès à la base
|
||||
\param port Port of database server
|
||||
\return resource Handler d'accès à la base
|
||||
\seealso close
|
||||
*/
|
||||
function connect($host, $login, $passwd, $name)
|
||||
function connect($host, $login, $passwd, $name, $port=0)
|
||||
{
|
||||
dolibarr_syslog("DoliDB::connect host=$host, login=$login, passwd=--hidden--, name=$name");
|
||||
$this->db = @mysql_connect($host, $login, $passwd);
|
||||
dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name");
|
||||
$newhost=$host;
|
||||
if ($port) $newhost.=':'.$port;
|
||||
$this->db = @mysql_connect($newhost, $login, $passwd);
|
||||
//force les enregistrement en latin1 si la base est en utf8 par défaut
|
||||
// Supprimé car plante sur mon PHP-Mysql. De plus, la base est forcement en latin1 avec
|
||||
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
||||
|
||||
@ -107,10 +107,10 @@ class DoliDb
|
||||
\param user Nom de l'utilisateur autorisé
|
||||
\param pass Mot de passe
|
||||
\param name Nom de la database
|
||||
\param newlink ???
|
||||
\param port Port of database server
|
||||
\return int 1 en cas de succès, 0 sinon
|
||||
*/
|
||||
function DoliDb($type='mysqli', $host, $user, $pass, $name='', $newlink=0)
|
||||
function DoliDb($type='mysqli', $host, $user, $pass, $name='', $port=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -157,7 +157,7 @@ class DoliDb
|
||||
}
|
||||
|
||||
// Essai connexion serveur
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $newlink);
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $port);
|
||||
|
||||
if ($this->db)
|
||||
{
|
||||
@ -225,13 +225,16 @@ class DoliDb
|
||||
\param login nom de l'utilisateur autoris
|
||||
\param passwd mot de passe
|
||||
\param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
|
||||
\param port Port of database server
|
||||
\return resource handler d'accès à la base
|
||||
\seealso close
|
||||
*/
|
||||
function connect($host, $login, $passwd, $name)
|
||||
function connect($host, $login, $passwd, $name, $port=0)
|
||||
{
|
||||
dolibarr_syslog("DoliDB::connect host=$host, login=$login, passwd=--hidden--, name=$name");
|
||||
$this->db = @mysqli_connect($host, $login, $passwd);
|
||||
dolibarr_syslog("DoliDB::connect host=$host, port=$port, login=$login, passwd=--hidden--, name=$name");
|
||||
$newhost=$host;
|
||||
if ($port) $newhost.=':'.$port;
|
||||
$this->db = @mysqli_connect($newhost, $login, $passwd);
|
||||
//force les enregistrement en latin1 si la base est en utf8 par défaut
|
||||
// Supprimé car plante sur mon PHP-Mysql. De plus, la base est forcement en latin1 avec
|
||||
// les nouvelles version de Dolibarr car forcé par l'install Dolibarr.
|
||||
|
||||
@ -65,9 +65,10 @@ class DoliDb
|
||||
\param user nom de l'utilisateur autorisé
|
||||
\param pass mot de passe
|
||||
\param name nom de la database
|
||||
\param port Port of database server
|
||||
\return int 1 en cas de succès, 0 sinon
|
||||
*/
|
||||
function DoliDb($type='pgsql', $host, $user, $pass, $name='')
|
||||
function DoliDb($type='pgsql', $host, $user, $pass, $name='', $port=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -110,7 +111,7 @@ class DoliDb
|
||||
}
|
||||
|
||||
// Essai connexion serveur
|
||||
$this->db = $this->connect($host, $user, $pass, $name);
|
||||
$this->db = $this->connect($host, $user, $pass, $name, $port);
|
||||
|
||||
if ($this->db)
|
||||
{
|
||||
@ -173,14 +174,15 @@ class DoliDb
|
||||
\param login nom de l'utilisateur autoris
|
||||
\param passwd mot de passe
|
||||
\param name nom de la database (ne sert pas sous mysql, sert sous pgsql)
|
||||
\param port Port of database server
|
||||
\return resource handler d'accès à la base
|
||||
*/
|
||||
function connect($host, $login, $passwd, $name)
|
||||
function connect($host, $login, $passwd, $name, $port=0)
|
||||
{
|
||||
if (!$name){
|
||||
$name="postgres";
|
||||
}
|
||||
$con_string = "host=$host dbname=$name user=$login password=$passwd";
|
||||
$con_string = "host=$host port=$port dbname=$name user=$login password=$passwd";
|
||||
$this->db = pg_connect($con_string);
|
||||
if ($this->db)
|
||||
{
|
||||
|
||||
@ -57,13 +57,14 @@ class Mantis {
|
||||
// Défini parametres mantis (avec substitution eventuelle)
|
||||
$mantistype=eregi_replace('__dolibarr_main_db_type__',$dolibarr_main_db_type,$conf->mantis->db->type);
|
||||
$mantishost=eregi_replace('__dolibarr_main_db_host__',$dolibarr_main_db_host,$conf->mantis->db->host);
|
||||
$mantisport=eregi_replace('__dolibarr_main_db_port__',$dolibarr_main_db_port,$conf->mantis->db->port);
|
||||
$mantisuser=eregi_replace('__dolibarr_main_db_user__',$dolibarr_main_db_user,$conf->mantis->db->user);
|
||||
$mantispass=eregi_replace('__dolibarr_main_db_pass__',$dolibarr_main_db_pass,$conf->mantis->db->pass);
|
||||
$mantisname=eregi_replace('__dolibarr_main_db_name__',$dolibarr_main_db_name,$conf->mantis->db->name);
|
||||
|
||||
// On initie la connexion à la base mantisendar
|
||||
require_once (DOL_DOCUMENT_ROOT ."/lib/databases/".$mantistype.".lib.php");
|
||||
$this->localdb = new DoliDb($mantistype,$mantishost,$mantisuser,$mantispass,$mantisname);
|
||||
$this->localdb = new DoliDb($mantistype,$mantishost,$mantisuser,$mantispass,$mantisname,$mantisport);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -74,14 +74,12 @@ else
|
||||
}
|
||||
}
|
||||
|
||||
if (! isset($dolibarr_main_db_type))
|
||||
{
|
||||
$dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
||||
}
|
||||
if (empty($dolibarr_main_data_root)) {
|
||||
// Si repertoire documents non defini, on utilise celui par defaut
|
||||
$dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root);
|
||||
$dolibarr_main_data_root.="/documents";
|
||||
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
||||
if (empty($dolibarr_main_data_root))
|
||||
{
|
||||
// Si repertoire documents non defini, on utilise celui par defaut
|
||||
$dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root);
|
||||
$dolibarr_main_data_root.="/documents";
|
||||
}
|
||||
define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem pages php (htdocs)
|
||||
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem donnes (documents)
|
||||
@ -120,10 +118,12 @@ require_once(DOL_DOCUMENT_ROOT."/conf/conf.class.php");
|
||||
$conf = new Conf();
|
||||
// Identifiant propres au serveur base de donnee
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=0; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
||||
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set='latin1';
|
||||
$conf->db->character_set=$dolibarr_main_db_character_set;
|
||||
@ -167,11 +167,11 @@ if (! defined('NOREQUIRETRAN'))
|
||||
*/
|
||||
if (! defined('NOREQUIREDB'))
|
||||
{
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
|
||||
if ($db->error)
|
||||
{
|
||||
dolibarr_print_error($db,"host=".$conf->db->host.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
|
||||
dolibarr_print_error($db,"host=".$conf->db->host.", port=".$conf->db->port.", user=".$conf->db->user.", databasename=".$conf->db->name.", ".$db->error);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,13 +57,14 @@ class Phenix {
|
||||
// Défini parametres phenix (avec substitution eventuelle)
|
||||
$phenixtype=eregi_replace('__dolibarr_main_db_type__',$dolibarr_main_db_type,$conf->phenix->db->type);
|
||||
$phenixhost=eregi_replace('__dolibarr_main_db_host__',$dolibarr_main_db_host,$conf->phenix->db->host);
|
||||
$phenixport=eregi_replace('__dolibarr_main_db_port__',$dolibarr_main_db_port,$conf->phenix->db->port);
|
||||
$phenixuser=eregi_replace('__dolibarr_main_db_user__',$dolibarr_main_db_user,$conf->phenix->db->user);
|
||||
$phenixpass=eregi_replace('__dolibarr_main_db_pass__',$dolibarr_main_db_pass,$conf->phenix->db->pass);
|
||||
$phenixname=eregi_replace('__dolibarr_main_db_name__',$dolibarr_main_db_name,$conf->phenix->db->name);
|
||||
|
||||
// On initie la connexion à la base Phenix
|
||||
require_once (DOL_DOCUMENT_ROOT ."/lib/databases/".$phenixtype.".lib.php");
|
||||
$this->localdb = new DoliDb($phenixtype,$phenixhost,$phenixuser,$phenixpass,$phenixname);
|
||||
$this->localdb = new DoliDb($phenixtype,$phenixhost,$phenixuser,$phenixpass,$phenixname,$phenixport);
|
||||
}
|
||||
|
||||
// TODO : Modifier la suite....
|
||||
|
||||
@ -31,6 +31,7 @@ require("../../don.class.php");
|
||||
|
||||
$conf = new Conf();
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
@ -42,7 +43,7 @@ if (! $conf->db->type) { $conf->db->type = 'mysql'; }
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT ."/lib/".$dolibarr_main_db_type.".lib.php");
|
||||
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
|
||||
$retbplc = new Retourbplc($db);
|
||||
|
||||
|
||||
@ -62,12 +62,13 @@ if (file_exists ($thermlib))
|
||||
|
||||
$conf = new Conf();
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
|
||||
$dbt = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name);
|
||||
$dbt = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
|
||||
$dontherm = new Don($dbt);
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ class ProcessGraphClients
|
||||
|
||||
$this->ident = $ident;
|
||||
$this->cpc = $cpc;
|
||||
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,1);
|
||||
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
}
|
||||
|
||||
function go($id=0)
|
||||
|
||||
@ -42,7 +42,7 @@ class ProcessGraphContrats
|
||||
|
||||
$this->ident = $ident;
|
||||
$this->cpc = $cpc;
|
||||
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,1);
|
||||
$this->db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
||||
$this->messages = array();
|
||||
}
|
||||
|
||||
|
||||
@ -58,13 +58,14 @@ class Webcal {
|
||||
// Défini parametres webcal (avec substitution eventuelle)
|
||||
$webcaltype=eregi_replace('__dolibarr_main_db_type__',$dolibarr_main_db_type,$conf->webcal->db->type);
|
||||
$webcalhost=eregi_replace('__dolibarr_main_db_host__',$dolibarr_main_db_host,$conf->webcal->db->host);
|
||||
$webcalport=eregi_replace('__dolibarr_main_db_port__',$dolibarr_main_db_port,$conf->webcal->db->port);
|
||||
$webcaluser=eregi_replace('__dolibarr_main_db_user__',$dolibarr_main_db_user,$conf->webcal->db->user);
|
||||
$webcalpass=eregi_replace('__dolibarr_main_db_pass__',$dolibarr_main_db_pass,$conf->webcal->db->pass);
|
||||
$webcalname=eregi_replace('__dolibarr_main_db_name__',$dolibarr_main_db_name,$conf->webcal->db->name);
|
||||
|
||||
// On initie la connexion à la base Webcalendar
|
||||
require_once (DOL_DOCUMENT_ROOT ."/lib/databases/".$webcaltype.".lib.php");
|
||||
$this->localdb = new DoliDb($webcaltype,$webcalhost,$webcaluser,$webcalpass,$webcalname);
|
||||
$this->localdb = new DoliDb($webcaltype,$webcalhost,$webcaluser,$webcalpass,$webcalname,$webcalport);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user