Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 174 | Rev 269 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 264
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Application de consultation des Collections.
4
 * Application de consultation des Collections.
5
 * Fichier principal d'initialisation. 
5
 * Fichier principal d'initialisation. 
6
 *
6
 *
7
 * @category	PHP5
7
 * @category	PHP5
8
 * @package		Collection
8
 * @package		Collection
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
 * @copyright	2010 Tela-Botanica
10
 * @copyright	2010 Tela-Botanica
11
 * @license		GPL-v3 et CECILL-v2
11
 * @license		GPL-v3 et CECILL-v2
12
 * @version		$Id: collection.php 174 2013-11-12 15:13:06Z raphael $
12
 * @version		$Id: collection.php 264 2016-12-19 13:27:31Z mathias $
13
 */
13
 */
14
// Autoload pour cette application
14
// Autoload pour cette application
15
function __autoload($nom_classe) {
15
function __autoload($nom_classe) {
16
	// Tableau des chemins à inclure pour trouver une classe relatif à ce fichier
16
	// Tableau des chemins à inclure pour trouver une classe relatif à ce fichier
17
	$chemins = array(
17
	$chemins = array(
18
		'bibliotheque'.DS.'dao',	
18
		'bibliotheque'.DS.'dao',	
19
		'bibliotheque'.DS.'pear',
19
		'bibliotheque'.DS.'pear',
20
		'bibliotheque'.DS.'utilitaires',
20
		'bibliotheque'.DS.'utilitaires',
21
		'controleurs',
21
		'controleurs',
22
		'composants',
22
		'composants',
23
		'composants'.DS.'cartographie');
23
		'composants'.DS.'cartographie');
24
	foreach ($chemins as $chemin) {
24
	foreach ($chemins as $chemin) {
25
		$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
25
		$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
26
		if (file_exists($fichier_a_inclure)) {
26
		if (file_exists($fichier_a_inclure)) {
27
			include_once $fichier_a_inclure;
27
			include_once $fichier_a_inclure;
28
			return null;
28
			return null;
29
		}
29
		}
30
	}
30
	}
31
}
31
}
32
 
32
 
33
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
33
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
34
// Sinon, rien ne sera chargé.
34
// Sinon, rien ne sera chargé.
35
// Chemin du fichier chargeant le framework requis
35
// Chemin du fichier chargeant le framework requis
36
$framework = dirname(__FILE__).'/framework.php';
36
$framework = dirname(__FILE__).'/framework.php';
37
if (!file_exists($framework)) {
37
if (!file_exists($framework)) {
38
	$e = "Veuillez paramêtrer l'emplacement et la version du Framework dans le fichier $framework";
38
	$e = "Veuillez paramêtrer l'emplacement et la version du Framework dans le fichier $framework";
39
	trigger_error($e, E_USER_ERROR);
39
	trigger_error($e, E_USER_ERROR);
40
} else {
40
} else {
41
	// Inclusion du Framework
41
	// Inclusion du Framework
42
    require_once(realpath($framework));
42
    require_once(realpath($framework));
43
	// Ajout d'information concernant cette application
43
	// Ajout d'information concernant cette application
44
	Application::setChemin(__FILE__);// Obligatoire
44
	Application::setChemin(__FILE__);// Obligatoire
45
	Application::setInfo(Config::get('info'));
45
	Application::setInfo(Config::get('info'));
-
 
46
	
46
	
47
 
47
	// Lancement du débogage si nécessaire
48
	// Lancement du débogage si nécessaire
48
	if (Config::get('chronometrage')) {
49
	if (Config::get('chronometrage')) {
49
		Chronometre::chrono('Collection.php - début');
50
		Chronometre::chrono('Collection.php - début');
50
	}
51
	}
51
	// Lancement de l'application
52
	// Lancement de l'application
-
 
53
restore_exception_handler();
-
 
54
restore_error_handler();
-
 
55
error_reporting(E_ALL);
52
	AppControleur::initialiser();
56
	AppControleur::initialiser();
53
}
57
}
54
?>
58
?>