Subversion Repositories Applications.framework

Rev

Rev 92 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 92 Rev 98
Line 1... Line 1...
1
<?php
1
<?php
2
/**
2
/**
3
 * Fichier contenant la fonction __autoload
3
 * Fichier contenant la fonction de chargement automatique de classes, il doit toujours rester à la racine
-
 
4
 * du framework car il initialise le chemin de l'application en se basant sur son propre emplacement.
4
 * 
5
 * 
5
 * Fichier contenant la fonction de chargement automatique 
-
 
6
 * de classes, il doit toujours rester à la racine
-
 
7
 *  du framework car il initialise le chemin de 
-
 
8
 * l'application en se basant sur son propre emplacement.
-
 
9
 * 
-
 
10
 * PHP Version 5
6
 * PHP Version 5.1.2
11
 * 
7
 * 
12
 * @category  Fichier_De_Fonctions
8
 * @category  Fichier_De_Fonctions
13
 * @package   Framework
9
 * @package   Framework
-
 
10
 // Auteur principal : 
14
 * @author    aurelien <aurelien@tela-botanica.org>
11
 * @author Aurelien PERONNET <aurelien@tela-botanica.org>
-
 
12
 // Autres auteurs :
15
 * @copyright 2009 Tela-Botanica
13
 * @author Jean-Pascal MILCENT <jpm@tela-botanica.org> 
-
 
14
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
16
 * @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL  
15
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
17
 * @version   SVN: <svn_id> 
16
 * @version $$Id$$
18
 * @link      /doc/framework/ 
17
 * @copyright 1999-2009 Tela Botanica (accueil@tela-botanica.org)
19
 */
18
 */
Line 20... Line 19...
20
 
19
 
21
// Redéfinition de la constante DIRECTORY_SEPARATOR
20
// Redéfinition de la constante DIRECTORY_SEPARATOR
22
if (!defined('DS')) { 
21
if (!defined('DS')) { 
Line 25... Line 24...
25
// Redéfinition de la constante PATH_SEPARATOR
24
// Redéfinition de la constante PATH_SEPARATOR
26
if (!defined('PS')) { 
25
if (!defined('PS')) { 
27
	define('PS', PATH_SEPARATOR);  
26
	define('PS', PATH_SEPARATOR);  
28
}
27
}
Line -... Line 28...
-
 
28
 
29
 
29
// Autoload pour le Framework
30
function autoloadFw($nom_classe_fw) {
30
function autoloadFw($nom_classe_fw) {
31
	$fichier_a_inclure = dirname(__FILE__).DS.$nom_classe_fw.'.php';
31
	$fichier_a_inclure = dirname(__FILE__).DS.$nom_classe_fw.'.php';
32
	if (file_exists($fichier_a_inclure)) {
32
	if (file_exists($fichier_a_inclure)) {
33
		include_once $fichier_a_inclure;
33
		include_once $fichier_a_inclure;
34
		return null;
34
		return null;
35
	}
35
	}
36
}
36
}
Line -... Line 37...
-
 
37
spl_autoload_register('autoloadFw');
37
spl_autoload_register('autoloadFw');
38
 
38
 
39
// Autoload par défaut pour l'application
39
function autoloadAppliDefaut($nom_classe) {
40
function autoloadAppliDefaut($nom_classe) {
40
	$dossiers_classes = array(	Config::get('dossier_controleurs'),
41
	$dossiers_classes = array(	Config::get('chemin_controleurs'),
Line 41... Line 42...
41
								Config::get('dossier_modeles'),
42
								Config::get('chemin_modeles'),
42
								Config::get('dossier_bibliotheque'));
43
								Config::get('chemin_bibliotheque'));
43
	
44
	
44
	foreach ($dossiers_classes as $chemin) {
45
	foreach ($dossiers_classes as $chemin) {
Line 49... Line 50...
49
		}
50
		}
50
	}
51
	}
51
}
52
}
52
spl_autoload_register('autoloadAppliDefaut');
53
spl_autoload_register('autoloadAppliDefaut');
Line -... Line 54...
-
 
54
 
53
 
55
// Autoload définit par l'application
54
if (function_exists('__autoload')) {
56
if (function_exists('__autoload')) {
55
	spl_autoload_register('__autoload');
57
	spl_autoload_register('__autoload');
56
}
-
 
57
 
58
}
58
?>
59
?>