18,17 → 18,7 |
private static $info = null; |
private static $chemin = null; |
|
/** |
* Le tableau des informations sur l'application possède les clés suivantes : |
* - nom : nom de l'application |
* - abr : abréviation de l'application |
* - encodage : encodage de l'application (ISO-8859-15, UTF-8...) |
* |
* @param string $chemin_fichier_principal |
* @param array $info tableau fournissant des informations sur l'application |
* @return void |
*/ |
public static function set($chemin_fichier_principal, $info = null) { |
public static function setChemin($chemin_fichier_principal) { |
if (self::$chemin === null) { |
if (!file_exists($chemin_fichier_principal)) { |
trigger_error("Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode set().", E_USER_ERROR); |
35,9 → 25,8 |
} else { |
self::$chemin = dirname($chemin_fichier_principal).DS; |
} |
self::$info = $info; |
} else { |
trigger_error("L'application a déjà été enregistrée auprès du Framework", E_USER_WARNING); |
trigger_error("Le chemin de l'application a déjà été enregistré auprès du Framework", E_USER_WARNING); |
} |
} |
|
45,6 → 34,22 |
return self::$chemin; |
} |
|
/** Le tableau des informations sur l'application possède les clés suivantes : |
* - nom : nom de l'application |
* - abr : abréviation de l'application |
* - encodage : encodage de l'application (ISO-8859-15, UTF-8...) |
* |
* @param array $info tableau fournissant des informations sur l'application |
* @return void |
*/ |
public static function setInfo($info) { |
if (self::$info === null) { |
self::$info = $info; |
} else { |
trigger_error("Le informations de l'application ont déjà été enregistrées auprès du Framework", E_USER_WARNING); |
} |
} |
|
public static function getInfo($cle = null) { |
if ($cle !== null) { |
if (isset(self::$info[$cle])) { |