| 95 |
jpm |
1 |
<?php
|
|
|
2 |
class Application {
|
|
|
3 |
|
|
|
4 |
private static $nom = null;
|
|
|
5 |
private static $abreviation = null;
|
|
|
6 |
private static $chemin = null;
|
|
|
7 |
|
|
|
8 |
public static function set($nom, $abreviation, $chemin_fichier_principal) {
|
|
|
9 |
if (self::$chemin === null) {
|
|
|
10 |
if (!file_exists($chemin_fichier_principal)) {
|
|
|
11 |
trigger_error("Le fichier indiqué n'existe pas. Utilisez __FILE__ dans la méthode set().", E_USER_WARNING);
|
|
|
12 |
} else {
|
|
|
13 |
self::$chemin = dirname($chemin_fichier_principal).DS;
|
|
|
14 |
}
|
|
|
15 |
self::$nom = $nom;
|
|
|
16 |
self::$abreviation = $abreviation;
|
|
|
17 |
} else {
|
|
|
18 |
trigger_error("L'application a déjà été enregistrée auprès du Framework", E_USER_WARNING);
|
|
|
19 |
}
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
public static function getChemin() {
|
|
|
23 |
return self::$chemin;
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
public static function getNom() {
|
|
|
27 |
return self::$nom;
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
public static function getAbreviation() {
|
|
|
31 |
return self::$code;
|
|
|
32 |
}
|
|
|
33 |
}
|