Support des virtual-host définit dans Apache

This commit is contained in:
Rodolphe Quiedeville 2003-09-12 17:29:16 +00:00
parent 751bddc764
commit 7d89831962

View File

@ -70,41 +70,47 @@ class PropalConf
*/ */
class DbConf { class DbConf {
Function DbConf() { Function DbConf()
{
$this->type = "mysql"; $this->type = "mysql";
$this->host = ""; $this->host = "";
$this->user = ""; $this->user = "";
$this->pass = ""; $this->pass = "";
$this->name = ""; $this->name = "";
/*
* If you want to activate virtualhosting you need tou use these lines and add
* this to your pache virtualhost file
SetEnv LLX_DBTYPE mysql
SetEnv LLX_DBHOST localhost
SetEnv LLX_DBUSER user
SetEnv LLX_DBPASS pass
SetEnv LLX_DBNAME dolibarr
*/
/* /*
* Ce bloc de code, casse l'authentification par Pear::Auth !! * If you want to activate virtualhosting you need tou use these lines and add
* La conf est positionnée dans conf.php les virtualhost ne sont * this to your pache virtualhost file
* pas encore valide SetEnv LLX_DBTYPE mysql
* SetEnv LLX_DBHOST localhost
$this->type = getenv("LLX_DBTYPE"); SetEnv LLX_DBUSER user
$this->host = getenv("LLX_DBHOST"); SetEnv LLX_DBPASS pass
$this->user = getenv("LLX_DBUSER"); SetEnv LLX_DBNAME dolibarr
$this->pass = getenv("LLX_DBPASS"); */
$this->name = getenv("LLX_DBNAME");
*/
if (strlen(getenv("LLX_DBNAME")))
{
$this->name = getenv("LLX_DBNAME");
if (strlen(getenv("LLX_DBTYPE")))
$this->type = getenv("LLX_DBTYPE");
if (strlen(getenv("LLX_DBHOST")))
$this->host = getenv("LLX_DBHOST");
if (strlen(getenv("LLX_DBUSER")))
$this->user = getenv("LLX_DBUSER");
if (strlen(getenv("LLX_DBPASS")))
$this->pass = getenv("LLX_DBPASS");
}
} }
/** return the dsn according to the pear syntax /** return the dsn according to the pear syntax
*/ */
function getdsn () Function getdsn()
{ {
return ($this->type.'://'.$this->user.':'.$this->pass.'@'.$this->host.'/'.$this->name); return ($this->type.'://'.$this->user.':'.$this->pass.'@'.$this->host.'/'.$this->name);
} }
} }