Skip to content
Snippets Groups Projects
Commit b98151db authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: A log handler can be loaded twice.

parent eeba48f9
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment