Subversion Repositories Applications.framework

Rev

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

Rev 241 Rev 268
Line 14... Line 14...
14
 * @package	Framework
14
 * @package	Framework
15
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
15
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
16
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
16
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
17
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
17
 * @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
18
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
18
 * @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
19
 * @version	$Id: Framework.php 241 2010-12-06 15:19:07Z jpm $
19
 * @version	$Id: Framework.php 268 2010-12-25 17:06:01Z jpm $
20
 * @since		0.3
20
 * @since		0.3
21
 * @link		/doc/framework/
21
 * @link		/doc/framework/
22
 */
22
 */
23
class Framework {
23
class Framework {
Line 40... Line 40...
40
	 * Initialise l'environnement nécessaire au Framework : constantes globales, méthodeles autoload, séparateur d'arguments 
40
	 * Initialise l'environnement nécessaire au Framework : constantes globales, méthodeles autoload, séparateur d'arguments 
41
	 * d'url.
41
	 * d'url.
42
	 * Cette méthode est appelée automatiquement suite à la définition du chemin de l'application via Application::setChemin().
42
	 * Cette méthode est appelée automatiquement suite à la définition du chemin de l'application via Application::setChemin().
43
	 */
43
	 */
44
	private static function initialiserEnvironnement() {
44
	private static function initialiserEnvironnement() {
45
		self::definirConstantesGlobales();
-
 
46
		self::enregistrerMethodesAutoload();
45
		self::enregistrerMethodesAutoload();
47
		self::initialiserUrl();
46
		self::initialiserUrl();
48
	}
47
	}
Line 49... Line 48...
49
	
48
	
Line 137... Line 136...
137
	public static function setCheminAppli($chemin_fichier_principal) {
136
	public static function setCheminAppli($chemin_fichier_principal) {
138
		if (self::$chemin === null) {
137
		if (self::$chemin === null) {
139
			if (!file_exists($chemin_fichier_principal)) {
138
			if (!file_exists($chemin_fichier_principal)) {
140
				trigger_error("Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode setCheminAppli().", E_USER_ERROR);
139
				trigger_error("Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode setCheminAppli().", E_USER_ERROR);
141
			} else {
140
			} else {
142
				self::initialiserEnvironnement();
141
				self::definirConstantesGlobales();
143
				self::$chemin = dirname($chemin_fichier_principal).DS;
142
				self::$chemin = dirname($chemin_fichier_principal).DS;
-
 
143
				self::initialiserEnvironnement();
144
				self::initialiserFramework();
144
				self::initialiserFramework();
145
			}
145
			}
146
		} else {
146
		} else {
147
			trigger_error("Le chemin de l'application a déjà été enregistré auprès du Framework", E_USER_WARNING);
147
			trigger_error("Le chemin de l'application a déjà été enregistré auprès du Framework", E_USER_WARNING);
148
		}
148
		}