Fix: Pas de plantage si echec inclusion.
This commit is contained in:
parent
642a68250f
commit
6ae407113d
@ -104,17 +104,22 @@ $bc[true]=' class="bg2"';
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Charge fichier conf (doit exister)
|
* \brief Load conf file (file must exists)
|
||||||
|
* \param dolibarr_main_document_root Root directory of Dolibarr bin files
|
||||||
|
* \return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function conf($dolibarr_main_document_root)
|
function conf($dolibarr_main_document_root)
|
||||||
{
|
{
|
||||||
require_once($dolibarr_main_document_root."/conf/conf.class.php");
|
|
||||||
global $conf;
|
global $conf;
|
||||||
global $dolibarr_main_db_type;
|
global $dolibarr_main_db_type;
|
||||||
global $dolibarr_main_db_host;
|
global $dolibarr_main_db_host;
|
||||||
global $dolibarr_main_db_name;
|
global $dolibarr_main_db_name;
|
||||||
global $dolibarr_main_db_user;
|
global $dolibarr_main_db_user;
|
||||||
global $dolibarr_main_db_pass;
|
global $dolibarr_main_db_pass;
|
||||||
|
|
||||||
|
$return=include_once($dolibarr_main_document_root."/conf/conf.class.php");
|
||||||
|
if (! $return) return -1;
|
||||||
|
|
||||||
$conf=new Conf();
|
$conf=new Conf();
|
||||||
$conf->db->type = trim($dolibarr_main_db_type);
|
$conf->db->type = trim($dolibarr_main_db_type);
|
||||||
$conf->db->host = trim($dolibarr_main_db_host);
|
$conf->db->host = trim($dolibarr_main_db_host);
|
||||||
@ -128,6 +133,7 @@ function conf($dolibarr_main_document_root)
|
|||||||
if (! isset($collation_connection) || ! $collation_connection) $collation_connection='latin1_swedish_ci';
|
if (! isset($collation_connection) || ! $collation_connection) $collation_connection='latin1_swedish_ci';
|
||||||
$conf->db->collation_connection=$collation_connection;
|
$conf->db->collation_connection=$collation_connection;
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user