Subversion Repositories Applications.framework

Rev

Rev 142 | Rev 158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 157
Line 10... Line 10...
10
 * @package   Framework
10
 * @package   Framework
11
 * @author	aurelien <aurelien@tela-botanica.org>
11
 * @author	aurelien <aurelien@tela-botanica.org>
12
 * @copyright 2009 Tela-Botanica
12
 * @copyright 2009 Tela-Botanica
13
 * @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
13
 * @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
14
 * @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
14
 * @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
15
 * @version   SVN: $$Id: GestionnaireException.php 142 2010-03-02 12:59:30Z jpm $$
15
 * @version   SVN: $$Id: GestionnaireException.php 157 2010-03-04 14:24:54Z aurelien $$
16
 * @link	  /doc/framework/
16
 * @link	  /doc/framework/
17
 *
17
 *
18
 */
18
 */
19
class GestionnaireException {
19
class GestionnaireException {
Line 26... Line 26...
26
	/**
26
	/**
27
	 * Détermine si l'on affiche ou non le contexte
27
	 * Détermine si l'on affiche ou non le contexte
28
	 */
28
	 */
29
	private static $contexte = false;
29
	private static $contexte = false;
Line -... Line 30...
-
 
30
 
-
 
31
	/**
-
 
32
	 * Détermine si l'on affiche ou non les erreur
-
 
33
	 */
-
 
34
	private static $afficher = false;
30
 
35
 
31
	 /**
36
	 /**
32
	 * Détermine si l'on loggue ou non les erreurs
37
	 * Détermine si l'on loggue ou non les erreurs
33
	 */
38
	 */
Line 50... Line 55...
50
	 */
55
	 */
51
	public function __construct() {
56
	public function __construct() {
52
		self::$exceptions = array();
57
		self::$exceptions = array();
53
		self::$contexte = Config::get('fw_debogage_contexte');
58
		self::$contexte = Config::get('fw_debogage_contexte');
54
		self::$logger = Config::get('fw_log_debogage');
59
		self::$logger = Config::get('fw_log_debogage');
-
 
60
		self::$afficher = Config::get('fw_debogage');
55
		self::$mode = php_sapi_name();
61
		self::$mode = php_sapi_name();
Line 56... Line 62...
56
 
62
 
57
		set_exception_handler(array(get_class($this),'gererException'));
63
		set_exception_handler(array(get_class($this),'gererException'));
58
		set_error_handler(array(get_class($this),'gererErreur'));
64
		set_error_handler(array(get_class($this),'gererErreur'));
Line 175... Line 181...
175
		Log::ajouterEntree('erreurs',$erreur);
181
		Log::ajouterEntree('erreurs',$erreur);
176
	}
182
	}
Line 177... Line 183...
177
 
183
 
178
	public function __destruct() {
184
	public function __destruct() {
179
		// Si des erreurs n'ont pas été affichée nous forçons leur affichage
185
		// Si des erreurs n'ont pas été affichée nous forçons leur affichage
180
		if (count(self::$exceptions) > 0) {
186
		if (self::$afficher && count(self::$exceptions) > 0) {
181
			echo self::getExceptions();
187
			echo self::getExceptions();
182
		}
188
		}
Line 183... Line 189...
183
	}
189
	}