Subversion Repositories Applications.framework

Rev

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

Rev 157 Rev 158
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 157 2010-03-04 14:24:54Z aurelien $$
15
 * @version   SVN: $$Id: GestionnaireException.php 158 2010-03-04 17:14:36Z jpm $$
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 30... Line -...
30
 
-
 
31
	/**
-
 
32
	 * Détermine si l'on affiche ou non les erreur
-
 
33
	 */
-
 
34
	private static $afficher = false;
-
 
35
 
30
 
36
	 /**
31
	 /**
37
	 * Détermine si l'on loggue ou non les erreurs
32
	 * Détermine si l'on loggue ou non les erreurs
38
	 */
33
	 */
Line 55... Line 50...
55
	 */
50
	 */
56
	public function __construct() {
51
	public function __construct() {
57
		self::$exceptions = array();
52
		self::$exceptions = array();
58
		self::$contexte = Config::get('fw_debogage_contexte');
53
		self::$contexte = Config::get('fw_debogage_contexte');
59
		self::$logger = Config::get('fw_log_debogage');
54
		self::$logger = Config::get('fw_log_debogage');
60
		self::$afficher = Config::get('fw_debogage');
-
 
61
		self::$mode = php_sapi_name();
55
		self::$mode = php_sapi_name();
Line 62... Line 56...
62
 
56
 
63
		set_exception_handler(array(get_class($this),'gererException'));
57
		set_exception_handler(array(get_class($this),'gererException'));
64
		set_error_handler(array(get_class($this),'gererErreur'));
58
		set_error_handler(array(get_class($this),'gererErreur'));
Line 181... Line 175...
181
		Log::ajouterEntree('erreurs',$erreur);
175
		Log::ajouterEntree('erreurs',$erreur);
182
	}
176
	}
Line 183... Line 177...
183
 
177
 
184
	public function __destruct() {
178
	public function __destruct() {
185
		// Si des erreurs n'ont pas été affichée nous forçons leur affichage
179
		// Si des erreurs n'ont pas été affichée nous forçons leur affichage
186
		if (self::$afficher && count(self::$exceptions) > 0) {
180
		if (count(self::$exceptions) > 0) {
187
			echo self::getExceptions();
181
			echo self::getExceptions();
188
		}
182
		}
Line 189... Line 183...
189
	}
183
	}