Subversion Repositories Applications.framework

Rev

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

Rev 96 Rev 98
Line 16... Line 16...
16
class Application {
16
class Application {
Line 17... Line 17...
17
 
17
 
18
	private static $info = null;
18
	private static $info = null;
Line 19... Line -...
19
	private static $chemin = null;
-
 
20
 
-
 
21
	/**
-
 
22
	 * Le tableau des informations sur l'application possède les clés suivantes :
-
 
23
	 * - nom : nom de l'application
-
 
24
	 * - abr : abréviation de l'application
-
 
25
	 * - encodage : encodage de l'application (ISO-8859-15, UTF-8...)
-
 
26
	 *
-
 
27
	 * @param string $chemin_fichier_principal
-
 
28
	 * @param array $info tableau fournissant des informations sur l'application
-
 
29
	 * @return void
19
	private static $chemin = null;
30
	 */
20
 
31
	public static function set($chemin_fichier_principal, $info = null) {
21
	public static function setChemin($chemin_fichier_principal) {
32
		if (self::$chemin === null) {
22
		if (self::$chemin === null) {
33
			if (!file_exists($chemin_fichier_principal)) {
23
			if (!file_exists($chemin_fichier_principal)) {
34
				trigger_error("Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode set().", E_USER_ERROR);
24
				trigger_error("Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode set().", E_USER_ERROR);
35
			} else {
25
			} else {
36
				self::$chemin = dirname($chemin_fichier_principal).DS;
-
 
37
			}
26
				self::$chemin = dirname($chemin_fichier_principal).DS;
38
			self::$info = $info;
27
			}
39
		} else {
28
		} else {
40
			trigger_error("L'application a déjà été enregistrée auprès du Framework", E_USER_WARNING);
29
			trigger_error("Le chemin de l'application a déjà été enregistré auprès du Framework", E_USER_WARNING);
Line 41... Line 30...
41
		}
30
		}
42
	}
31
	}
43
 
32
 
Line -... Line 33...
-
 
33
	public static function getChemin() {
-
 
34
		return self::$chemin;
-
 
35
	}
-
 
36
 
-
 
37
	/** Le tableau des informations sur l'application possède les clés suivantes :
-
 
38
	 * - nom : nom de l'application
-
 
39
	 * - abr : abréviation de l'application
-
 
40
	 * - encodage : encodage de l'application (ISO-8859-15, UTF-8...)
-
 
41
	 *
-
 
42
	 * @param array $info tableau fournissant des informations sur l'application
-
 
43
	 * @return void
-
 
44
	 */
-
 
45
	public static function setInfo($info) {
-
 
46
		if (self::$info === null) {
-
 
47
			self::$info = $info;
-
 
48
		} else {
44
	public static function getChemin() {
49
			trigger_error("Le informations de l'application ont déjà été enregistrées auprès du Framework", E_USER_WARNING);
45
		return self::$chemin;
50
		}
46
	}
51
	}
47
 
52
 
48
	public static function getInfo($cle = null) {
53
	public static function getInfo($cle = null) {