Fix: A log handler can be loaded twice.
This commit is contained in:
parent
eeba48f9b0
commit
b98151db94
@ -454,7 +454,7 @@ class Conf
|
||||
throw new Exception('Log handler does not extend LogHandlerInterface');
|
||||
}
|
||||
|
||||
$this->loghandlers[]=$loghandlerinstance;
|
||||
$this->loghandlers[$handler]=$loghandlerinstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user