| Line 7... |
Line 7... |
| 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 142 2010-08-30 12:41:00Z jpm $
|
12 |
* @version $Id: collection.php 174 2013-11-12 15:13:06Z raphael $
|
| 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 |
'composants',
|
22 |
'composants',
|
| 22 |
'composants'.DS.'cartographie');
|
23 |
'composants'.DS.'cartographie');
|
| 23 |
foreach ($chemins as $chemin) {
|
24 |
foreach ($chemins as $chemin) {
|
| 24 |
$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
|
25 |
$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
|
| 25 |
if (file_exists($fichier_a_inclure)) {
|
26 |
if (file_exists($fichier_a_inclure)) {
|
| Line 36... |
Line 37... |
| 36 |
if (!file_exists($framework)) {
|
37 |
if (!file_exists($framework)) {
|
| 37 |
$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";
|
| 38 |
trigger_error($e, E_USER_ERROR);
|
39 |
trigger_error($e, E_USER_ERROR);
|
| 39 |
} else {
|
40 |
} else {
|
| 40 |
// Inclusion du Framework
|
41 |
// Inclusion du Framework
|
| 41 |
require_once $framework;
|
42 |
require_once(realpath($framework));
|
| 42 |
// Ajout d'information concernant cette application
|
43 |
// Ajout d'information concernant cette application
|
| 43 |
Application::setChemin(__FILE__);// Obligatoire
|
44 |
Application::setChemin(__FILE__);// Obligatoire
|
| 44 |
Application::setInfo(Config::get('info'));
|
45 |
Application::setInfo(Config::get('info'));
|
| Line 45... |
Line 46... |
| 45 |
|
46 |
|