Voici une fonction qui répond à la question :

function includeWithException($fichier){
    if ( @ ! include($fichier)){
        throw new Exception("$fichier n'a pas été trouvé.");
    }
}
Répondu: 5 août 2011, 11:27
epommate
232

Révision 5 août 2011, 11:27 - epommate

Voici une fonction qui répond à la question :

function include_with_exception($fichier){
if ( @ ! include($fichier)){
throw new Exception("$fichier n'a pas été trouvé.");
}
}