Rev 180 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php// declare(encoding='UTF-8');/*** Fichier contenant la fonction de chargement automatique de classes, il doit toujours rester à la racine* du framework car il initialise le chemin de l'application en se basant sur son propre emplacement.** PHP Version 5.1.2** @category Fichier_De_Fonctions* @package Framework// Auteur principal :* @author Aurelien PERONNET <aurelien@tela-botanica.org>// Autres auteurs :* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>* @version $$Id: autoload.inc.php 188 2010-04-29 12:09:17Z jpm $$* @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)*/// Redéfinition de la constante DIRECTORY_SEPARATORif (!defined('DS')) {define('DS', DIRECTORY_SEPARATOR);}// Redéfinition de la constante PATH_SEPARATORif (!defined('PS')) {define('PS', PATH_SEPARATOR);}// Autoload pour le Frameworkfunction autoloadFw($nom_classe_fw) {$fichier_a_inclure = dirname(__FILE__).DS.$nom_classe_fw.'.php';if (file_exists($fichier_a_inclure)) {include_once $fichier_a_inclure;return null;}}spl_autoload_register('autoloadFw');// Initialisation du gestionnaire d'erreur avant toute choseGestionnaireException::initialiser();// Autoload par défaut pour l'applicationfunction autoloadAppliDefaut($nom_classe) {$dossiers_classes = array( Config::get('chemin_controleurs'),Config::get('chemin_modeles'),Config::get('chemin_bibliotheque'));foreach ($dossiers_classes as $chemin) {$fichier_a_tester = $chemin.$nom_classe.'.php';if (file_exists($fichier_a_tester)) {include_once $fichier_a_tester;return null;}}}spl_autoload_register('autoloadAppliDefaut');// Autoload défini par l'applicationif (function_exists('__autoload')) {spl_autoload_register('__autoload');}?>