Subversion Repositories Applications.referentiel

Rev

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

Rev Author Line No. Line
6 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Application permettant de tester, versionner et consulter les référentiels de travail.
5
 * Fichier principal d'initialisation.
6
 *
7
 * @category	PHP5
8
 * @package		Referentiel
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
 * @copyright	2010 Tela-Botanica
11
 * @license		GPL-v3 et CECILL-v2
12
 * @version		SVN:$Id$
13
 */
14
// Autoload pour cette application
15
function __autoload($nom_classe) {
16
	// Tableau des chemins à inclure pour trouver une classe relatif à ce fichier
17
	$chemins = array(
49 jpm 18
		'..'.DS.'bibliotheque'.DS.'dao',
19
		'..'.DS.'bibliotheque'.DS.'utilitaires',
6 jpm 20
		'bibliotheque'.DS.'pear',
21
		'composants');
22
	foreach ($chemins as $chemin) {
23
		$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
24
		if (file_exists($fichier_a_inclure)) {
25
			include_once $fichier_a_inclure;
26
			return null;
27
		}
28
	}
29
}
30
 
31
// Le fichier autoload.inc.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
32
// Sinon, rien ne sera chargé.
33
// Chemin du fichier chargeant le framework requis
34
$framework = dirname(__FILE__).'/framework.php';
35
if (!file_exists($framework)) {
36
	$e = "Veuillez paramêtrer l'emplacement et la version du Framework dans le fichier $framework";
37
	trigger_error($e, E_USER_ERROR);
38
} else {
39
	// Inclusion du Framework
40
	require_once $framework;
41
	// Ajout d'information concernant cette application
42
	Application::setChemin(__FILE__);// Obligatoire
43
	Application::setInfo(Config::get('info'));
44
 
325 delphine 45
 
6 jpm 46
	// Lancement de l'application
47
	Referentiel::initialiser();
48
}
49
?>