Subversion Repositories Applications.framework

Rev

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

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