Valider 0a867222 rédigé par nicod's avatar nicod
Parcourir les fichiers

Logger les erreurs runtime, startup et compile

parent 879e4565
Chargement en cours
Chargement en cours
Chargement en cours
Chargement en cours
+16 −0
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -222,6 +222,22 @@ function debug_table($tab = array(), $return = false, $value_legnth = false) {

function dd_affiche_infos() {

	// Logger les erreurs runtime, startup et compile
	if ($error = error_get_last()){
		switch($error['type']){
			case E_ERROR:
			// Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted.
			case E_CORE_ERROR:
			// Fatal errors that occur during PHP's initial startup. This is like an E_ERROR, except it is generated by the core of PHP.
			case E_COMPILE_ERROR:
			// Fatal compile-time errors. This is like an E_ERROR, except it is generated by the Zend Scripting Engine.
			case E_USER_ERROR:
			// User-generated error message. This is like an E_ERROR, except it is generated in PHP code by using the PHP function trigger_error(). 
			spip_log($error, 'dd_php');
				break;
		}
	}
	
	// 1 - vérifier si on doit afficher les infos ou les logger

	$header_html = false;