1 |
<?php
|
1 |
<?php
|
2 |
// Encodage : UTF-8
|
2 |
// Encodage : UTF-8
|
3 |
// Permet d'afficher le temps d'execution du service
|
3 |
// Permet d'afficher le temps d'execution du service
|
4 |
$temps_debut = (isset($_GET['chrono']) && $_GET['chrono'] == 1) ? microtime(true) : '';
|
4 |
$temps_debut = (isset($_GET['chrono']) && $_GET['chrono'] == 1) ? microtime(true) : '';
|
5 |
// +-------------------------------------------------------------------------------------------------------------------+
|
5 |
// +-------------------------------------------------------------------------------------------------------------------+
|
6 |
/**
|
6 |
/**
|
7 |
* Serveur
|
7 |
* Serveur
|
8 |
*
|
8 |
*
|
9 |
* Description : initialise le chargement et l'exécution des services web.
|
9 |
* Description : initialise le chargement et l'exécution des services web.
|
10 |
*
|
10 |
*
|
11 |
//Auteur original :
|
11 |
//Auteur original :
|
12 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
12 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
13 |
* @copyright Tela-Botanica 1999-2008
|
13 |
* @copyright Tela-Botanica 1999-2008
|
14 |
* @licence GPL v3 & CeCILL v2
|
14 |
* @licence GPL v3 & CeCILL v2
|
15 |
* @version $Id$
|
15 |
* @version $Id$
|
16 |
*/
|
16 |
*/
|
17 |
// +-------------------------------------------------------------------------------------------------------------------+
|
17 |
// +-------------------------------------------------------------------------------------------------------------------+
|
18 |
|
18 |
|
19 |
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
|
19 |
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
|
20 |
// Sinon, rien ne sera chargé.
|
20 |
// Sinon, rien ne sera chargé.
|
21 |
// Chemin du fichier chargeant le framework requis
|
21 |
// Chemin du fichier chargeant le framework requis
|
22 |
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';
|
22 |
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';
|
23 |
if (!file_exists($framework)) {
|
23 |
if (!file_exists($framework)) {
|
24 |
$e = "Veuillez paramétrer l'emplacement et la version du Framework dans le fichier $framework";
|
24 |
$e = "Veuillez paramétrer l'emplacement et la version du Framework dans le fichier $framework";
|
25 |
trigger_error($e, E_USER_ERROR);
|
25 |
trigger_error($e, E_USER_ERROR);
|
26 |
} else {
|
26 |
} else {
|
27 |
// Inclusion du Framework
|
27 |
// Inclusion du Framework
|
28 |
require_once $framework;
|
28 |
require_once $framework;
|
29 |
// Ajout d'information concernant cette application
|
29 |
// Ajout d'information concernant cette application
|
30 |
Framework::setCheminAppli(__FILE__);// Obligatoire
|
30 |
Framework::setCheminAppli(__FILE__);// Obligatoire
|
31 |
Framework::setInfoAppli(Config::get('info'));
|
31 |
Framework::setInfoAppli(Config::get('info'));
|
32 |
|
32 |
|
33 |
// Initialisation et lancement du serveur
|
33 |
// Initialisation et lancement du serveur
|
34 |
$Serveur = new Serveur();
|
34 |
$Serveur = new RestServeur();
|
35 |
$Serveur->executer();
|
35 |
$Serveur->executer();
|
36 |
|
36 |
|
37 |
// Affiche le temps d'execution du service
|
37 |
// Affiche le temps d'execution du service
|
38 |
if (isset($_GET['chrono']) && $_GET['chrono'] == 1) {
|
38 |
if (isset($_GET['chrono']) && $_GET['chrono'] == 1) {
|
39 |
$temps_fin = microtime(true);
|
39 |
$temps_fin = microtime(true);
|
40 |
echo 'Temps d\'execution : '.round($temps_fin - $temps_debut, 4);
|
40 |
echo 'Temps d\'execution : '.round($temps_fin - $temps_debut, 4);
|
41 |
}
|
41 |
}
|
42 |
}
|
42 |
}
|
43 |
?>
|
43 |
?>
|