Fix: A log handler can be loaded twice.

This commit is contained in:
Laurent Destailleur 2013-01-28 12:22:12 +01:00
parent eeba48f9b0
commit b98151db94
3 changed files with 8 additions and 4 deletions

View File

@ -454,7 +454,7 @@ class Conf
throw new Exception('Log handler does not extend LogHandlerInterface');
}
$this->loghandlers[]=$loghandlerinstance;
$this->loghandlers[$handler]=$loghandlerinstance;
}
}
}

View File

@ -142,6 +142,10 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i',$action))
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
// Create the global $hookmanager object
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db);
$ok = 0;
// If first install

View File

@ -228,7 +228,7 @@ foreach ($handlers as $handler)
throw new Exception('Log handler does not extend LogHandlerInterface');
}
$conf->loghandlers[]=$loghandlerinstance;
if (empty($conf->loghandlers[$handler])) $conf->loghandlers[$handler]=$loghandlerinstance;
}
@ -331,8 +331,8 @@ function conf($dolibarr_main_document_root)
{
throw new Exception('Log handler does not extend LogHandlerInterface');
}
$conf->loghandlers[]=$loghandlerinstance;
if (empty($conf->loghandlers[$handler])) $conf->loghandlers[$handler]=$loghandlerinstance;
}
return 1;