Subversion Repositories Applications.framework

Rev

Rev 96 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
class Application {
        
        private static $nom = null;
        private static $abreviation = null;
        private static $chemin = null;
        
        public static function set($nom, $abreviation, $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_WARNING);
                        } else {
                                self::$chemin = dirname($chemin_fichier_principal).DS;
                        }
                        self::$nom = $nom;
                        self::$abreviation = $abreviation;
                } else {
                        trigger_error("L'application a déjà été enregistrée auprès du Framework", E_USER_WARNING);
                }
        }

        public static function getChemin() {
                return self::$chemin;
        }
        
        public static function getNom() {
                return self::$nom;
        }
        
        public static function getAbreviation() {
                return self::$code;
        }
}