Rev 1826 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*** Initialise le chargement et l'exécution des services web.** @category DEL* @package Services* @subpackage Bibliotheque* @version 0.1* @author Mathias CHOUET <mathias@tela-botanica.org>* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>* @author Aurelien PERONNET <aurelien@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>* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>*/// Permet d'afficher le temps d'execution du service$temps_debut = (isset($_GET['chrono']) && $_GET['chrono'] == 1) ? microtime(true) : '';// Autoloader pour les namespaces, à base de routesfunction __autoload($nom_classe) {//echo "AUTOLOAD\n";$dernierAS = strrpos($nom_classe, "\\");$ns = substr($nom_classe, 0, $dernierAS);$nom = substr($nom_classe, strrpos($nom_classe, "\\") + 1);//echo "Recherche : $nom / $ns\n";// Routes selon les namespaces$routes = array('TelaBotanica\Del\Commun' => Config::get('chemin_del_commun'));if (array_key_exists($ns, $routes)) {//echo "Route trouvée: " . $routes[$ns] . "\n";$fichier_a_inclure = dirname(__FILE__) . DS . $routes[$ns] . DS . $nom . '.php';if (file_exists($fichier_a_inclure)) {include_once $fichier_a_inclure;return null;}}}// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.// Sinon, rien ne sera chargé.// Chemin du fichier chargeant le framework requis$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';if (!file_exists($framework)) {$e = "Veuillez paramétrer l'emplacement et la version du Framework dans le fichier $framework";trigger_error($e, E_USER_ERROR);} else {// Inclusion du Frameworkrequire_once $framework;// Ajout d'information concernant cette applicationFramework::setCheminAppli(__FILE__);// ObligatoireFramework::setInfoAppli(Config::get('info'));// Initialisation et lancement du serveur$Serveur = new RestServeur();$Serveur->executer();}