Subversion Repositories Applications.annuaire

Rev

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

Rev 320 Rev 414
1
<?php
1
<?php
2
/**
2
/**
3
* PHP Version 5
3
* PHP Version 5
4
*
4
*
5
* @category  PHP
5
* @category  PHP
6
* @package   annuaire
6
* @package   annuaire
7
* @author    aurelien <aurelien@tela-botanica.org>
7
* @author    aurelien <aurelien@tela-botanica.org>
8
* @copyright 2010 Tela-Botanica
8
* @copyright 2010 Tela-Botanica
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
* @version   SVN: <svn_id>
10
* @version   SVN: <svn_id>
11
* @link      /doc/annuaire/
11
* @link      /doc/annuaire/
12
*/
12
*/
13
 
13
 
14
// La fonction autolad doit être appelée avant tout autre chose dans l'application.
14
// La fonction autolad doit être appelée avant tout autre chose dans l'application.
15
// Sinon, rien ne sera chargé.
15
// Sinon, rien ne sera chargé.
-
 
16
// possibilité:
-
 
17
// $ ln -s ~/framework/branches/v0.2-buhl/framework/autoload.inc.php framework.php
16
require_once 'framework.php';
18
require_once 'framework.php';
17
Application::setChemin(__FILE__);
19
Application::setChemin(__FILE__);
18
Application::setInfo(Config::get('info'));
20
Application::setInfo(Config::get('info'));
19
mb_internal_encoding(Config::get('appli_encodage'));
21
mb_internal_encoding(Config::get('appli_encodage'));
20
date_default_timezone_set(Config::get('fw_timezone'));
22
date_default_timezone_set(Config::get('fw_timezone'));
21
 
23
 
22
// Autoload pour cette application
24
// Autoload pour cette application
23
function __autoload($nom_classe) {
25
function __autoload($nom_classe) {
24
    // Tableau des chemins à inclure pour trouver une classe relative à ce fichier
26
    // Tableau des chemins à inclure pour trouver une classe relative à ce fichier
25
    $chemins = array(
27
    $chemins = array(
26
    	'plugins',
28
    	'plugins',
27
        'composants',
29
        'composants',
28
        'composants'.DS.'cartographie',
30
        'composants'.DS.'cartographie',
29
        'composants'.DS.'openid');
31
        'composants'.DS.'openid');
30
    foreach ($chemins as $chemin) {
32
    foreach ($chemins as $chemin) {
31
        $fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
33
        $fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
32
 
34
 
33
        if (file_exists($fichier_a_inclure)) {
35
        if (file_exists($fichier_a_inclure)) {
34
            include_once $fichier_a_inclure;
36
            include_once $fichier_a_inclure;
35
            return null;
37
            return null;
36
        }
38
        }
37
    }
39
    }
38
}
40
}
39
 
41
 
40
?>
42
?>