| Line 1... |
Line 1... |
| 1 |
<?php
|
1 |
<?php
|
| - |
|
2 |
/**
|
| - |
|
3 |
* Initialise le chargement et l'exécution des services web.
|
| - |
|
4 |
*
|
| - |
|
5 |
* @category DEL
|
| 2 |
// Encodage : UTF-8
|
6 |
* @package Services
|
| - |
|
7 |
* @subpackage Bibliotheque
|
| - |
|
8 |
* @version 0.1
|
| - |
|
9 |
* @author Mathias CHOUET <mathias@tela-botanica.org>
|
| - |
|
10 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
| - |
|
11 |
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
|
| - |
|
12 |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
|
| - |
|
13 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
|
| - |
|
14 |
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
|
| - |
|
15 |
*/
|
| - |
|
16 |
|
| 3 |
// Permet d'afficher le temps d'execution du service
|
17 |
// Permet d'afficher le temps d'execution du service
|
| 4 |
$temps_debut = (isset($_GET['chrono']) && $_GET['chrono'] == 1) ? microtime(true) : '';
|
18 |
$temps_debut = (isset($_GET['chrono']) && $_GET['chrono'] == 1) ? microtime(true) : '';
|
| 5 |
// +-------------------------------------------------------------------------------------------------------------------+
|
- |
|
| 6 |
/**
|
- |
|
| 7 |
* Serveur
|
- |
|
| 8 |
*
|
- |
|
| 9 |
* Description : initialise le chargement et l'exécution des services web.
|
- |
|
| 10 |
*
|
- |
|
| 11 |
//Auteur original :
|
- |
|
| 12 |
* @author auteur <aut@tela-botanica.org>
|
- |
|
| 13 |
* @copyright Tela-Botanica 1999-2008
|
- |
|
| 14 |
* @licence GPL v3 & CeCILL v2
|
- |
|
| 15 |
* @version $Id$
|
- |
|
| 16 |
*/
|
- |
|
| 17 |
// +-------------------------------------------------------------------------------------------------------------------+
|
- |
|
| Line 18... |
Line 19... |
| 18 |
|
19 |
|
| 19 |
// Autoloader pour les namespaces, à base de routes
|
20 |
// Autoloader pour les namespaces, à base de routes
|
| 20 |
function __autoload($nom_classe) {
|
21 |
function __autoload($nom_classe) {
|
| 21 |
//echo "AUTOLOAD\n";
|
22 |
//echo "AUTOLOAD\n";
|
| 22 |
$dernierAS = strrpos($nom_classe, "\\");
|
23 |
$dernierAS = strrpos($nom_classe, "\\");
|
| 23 |
$ns = substr($nom_classe, 0, $dernierAS);
|
24 |
$ns = substr($nom_classe, 0, $dernierAS);
|
| 24 |
$nom = substr($nom_classe, strrpos($nom_classe, "\\") + 1);
|
25 |
$nom = substr($nom_classe, strrpos($nom_classe, "\\") + 1);
|
| 25 |
//echo "Recherche : $nom / $ns\n";
|
26 |
//echo "Recherche : $nom / $ns\n";
|
| 26 |
// Routes selon les namespaces
|
- |
|
| 27 |
$routes = array(
|
27 |
// Routes selon les namespaces
|
| 28 |
'TelaBotanica\Del\Commun' => Config::get('cheminDelCommun')
|
- |
|
| 29 |
);
|
28 |
$routes = array('TelaBotanica\Del\Commun' => Config::get('cheminDelCommun'));
|
| 30 |
if (array_key_exists($ns, $routes)) {
|
29 |
if (array_key_exists($ns, $routes)) {
|
| 31 |
//echo "Route trouvée: " . $routes[$ns] . "\n";
|
30 |
//echo "Route trouvée: " . $routes[$ns] . "\n";
|
| 32 |
$fichier_a_inclure = dirname(__FILE__) . DS . $routes[$ns] . DS . $nom . '.php';
|
31 |
$fichier_a_inclure = dirname(__FILE__) . DS . $routes[$ns] . DS . $nom . '.php';
|
| 33 |
if (file_exists($fichier_a_inclure)) {
|
32 |
if (file_exists($fichier_a_inclure)) {
|
| Line 52... |
Line 51... |
| 52 |
Framework::setInfoAppli(Config::get('info'));
|
51 |
Framework::setInfoAppli(Config::get('info'));
|
| Line 53... |
Line 52... |
| 53 |
|
52 |
|
| 54 |
// Initialisation et lancement du serveur
|
53 |
// Initialisation et lancement du serveur
|
| 55 |
$Serveur = new RestServeur();
|
54 |
$Serveur = new RestServeur();
|
| 56 |
$Serveur->executer();
|
- |
|
| 57 |
}
|
- |
|
| 58 |
?>
|
55 |
$Serveur->executer();
|
| - |
|
56 |
}
|
| 59 |
|
57 |
|