'Erreur', "niy" => 'Pas encore implémenté', "info" => 'Info', "sql" => 'Requête SQL', "erreur_sql" => 'Erreur SQL', "permission" => 'Permission non accordée' ); public static $filtre_erreurs = array( "erreur" => true, "niy" => true, "info" => true, "sql" => false, "erreur_sql" => true, "permission" => true ); public static $toutes_erreurs = false; // true <=> ignorer le filtre. public static $erreurs = array(); public static function __callStatic($nom, $args) { if (!array_key_exists($nom, self::$types_erreur)) { self::erreur("Type d'erreur inconnu : " . $nom . "\nArguments de Debug::$nom() : " . var_export($args, true)); } elseif (count($args) != 1) { self::erreur("Mauvais nombre d'arguments pour Debug::$nom().\nArguments : " . var_export($args, true)); } else { self::push($nom, $args[0]); } } public static function push($cat, $msg) { array_push(self::$erreurs, array($cat, $msg)); } public static function erreur($msg) { self::push("erreur", $msg); self::die_btrace(); } public static function erreur_sql() { self::push("erreur_sql", mysql_error()); self::die_btrace(); } public static function die_btrace() { echo self::afficher(true, true, false); echo '
'; $ret .= '"; } return $ret; } } function niy($name) { Debug::niy($name); } ?>Erreurs'; } if ($print) { foreach (self::$erreurs as $e) { if (self::$toutes_erreurs === true || self::$filtre_erreurs[$e[0]] === true) { $ret .= self::$types_erreur[$e[0]] . " : " . $e[1] . "\n"; } } } if ($end) { $ret .= "