Subversion Repositories Applications.framework

Rev

Rev 233 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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