Subversion Repositories Applications.framework

Rev

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

Rev 98 Rev 129
Line 1... Line 1...
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
* Classe fournissant des informations au Framework sur l'application.
4
 * Classe fournissant des informations au Framework sur l'application.
5
*
5
 *
6
* @package Framework
6
 * PHP version 5
-
 
7
 *
7
* @category Debogage
8
 * @category Debogage
-
 
9
 * @package Framework
8
// Auteur principal :
10
 // Auteur principal :
9
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
11
 * @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
// Autres auteurs :
12
 // Autres auteurs :
11
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
13
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
12
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
14
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
13
* @version $$Id$$
15
 * @version $$Id$$
14
* @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
16
 * @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
15
*/
17
 */
16
class Application {
18
class Application {
Line -... Line 19...
-
 
19
 
-
 
20
	/**
-
 
21
	 * tableau d'informations sur l'application
17
 
22
	 */
-
 
23
	private static $info = null;
-
 
24
	/**
-
 
25
	 * chemin de base de l'application
18
	private static $info = null;
26
	 */
Line -... Line 27...
-
 
27
	private static $chemin = null;
-
 
28
 
-
 
29
	/**
-
 
30
	 * Modificateur pour le chemin de base
19
	private static $chemin = null;
31
	 * @param string $chemin_fichier_principal chemin de base
20
 
32
	 */
21
	public static function setChemin($chemin_fichier_principal) {
33
	public static function setChemin($chemin_fichier_principal) {
22
		if (self::$chemin === null) {
34
		if (self::$chemin === null) {
23
			if (!file_exists($chemin_fichier_principal)) {
35
			if (!file_exists($chemin_fichier_principal)) {
Line 28... Line 40...
28
		} else {
40
		} else {
29
			trigger_error("Le chemin de l'application a déjà été enregistré auprès du Framework", E_USER_WARNING);
41
			trigger_error("Le chemin de l'application a déjà été enregistré auprès du Framework", E_USER_WARNING);
30
		}
42
		}
31
	}
43
	}
Line -... Line 44...
-
 
44
 
-
 
45
	/**
-
 
46
	 * accesseur pour le chemin
-
 
47
	 * @return string le chemin
32
 
48
	 */
33
	public static function getChemin() {
49
	public static function getChemin() {
34
		return self::$chemin;
50
		return self::$chemin;
Line 35... Line 51...
35
	}
51
	}
Line 48... Line 64...
48
		} else {
64
		} else {
49
			trigger_error("Le informations de l'application ont déjà été enregistrées auprès du Framework", E_USER_WARNING);
65
			trigger_error("Le informations de l'application ont déjà été enregistrées auprès du Framework", E_USER_WARNING);
50
		}
66
		}
51
	}
67
	}
Line -... Line 68...
-
 
68
 
-
 
69
	/**
-
 
70
	 * accesseur pour le tableau d'infos
-
 
71
	 * @param string $cle la clé à laquelle on veut accéder
52
 
72
	 */
53
	public static function getInfo($cle = null) {
73
	public static function getInfo($cle = null) {
54
		if ($cle !== null) {
74
		if ($cle !== null) {
55
			if (isset(self::$info[$cle])) {
75
			if (isset(self::$info[$cle])) {
56
				return self::$info[$cle];
76
				return self::$info[$cle];