Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1020 Rev 1565
Line 14... Line 14...
14
* @licence      GPL v3 & CeCILL v2
14
* @licence      GPL v3 & CeCILL v2
15
* @version      $Id$
15
* @version      $Id$
16
*/
16
*/
17
// +-------------------------------------------------------------------------------------------------------------------+
17
// +-------------------------------------------------------------------------------------------------------------------+
Line -... Line 18...
-
 
18
 
-
 
19
 
-
 
20
 
-
 
21
// Autoloader pour les namespaces, à base de routes
-
 
22
function __autoload($nom_classe) {
-
 
23
	//echo "AUTOLOAD\n";
-
 
24
	$dernierAS = strrpos($nom_classe, "\\");
-
 
25
	$ns = substr($nom_classe, 0, $dernierAS);
-
 
26
	$nom = substr($nom_classe, strrpos($nom_classe, "\\") + 1);
-
 
27
	//echo "Recherche : $nom / $ns\n";
-
 
28
	// Routes selon les namespaces
-
 
29
	$routes = array(
-
 
30
		'TelaBotanica\Del\Commun' => '..' . DS . 'commun'
-
 
31
	);
-
 
32
	if (array_key_exists($ns, $routes)) {
-
 
33
		//echo "Route trouvée: " . $routes[$ns] . "\n";
-
 
34
		$fichier_a_inclure = dirname(__FILE__) . DS . $routes[$ns] . DS . $nom . '.php';
-
 
35
		if (file_exists($fichier_a_inclure)) {
-
 
36
			include_once $fichier_a_inclure;
-
 
37
			return null;
-
 
38
		}
-
 
39
	}
-
 
40
}
18
 
41
 
19
// Le fichier Framework.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
42
// Le fichier Framework.php du Framework de Tela Botanica doit être appelée avant tout autre chose dans l'application.
20
// Sinon, rien ne sera chargé.
43
// Sinon, rien ne sera chargé.
21
// Chemin du fichier chargeant le framework requis
44
// Chemin du fichier chargeant le framework requis
22
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';
45
$framework = dirname(__FILE__).DIRECTORY_SEPARATOR.'framework.php';