Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 145 Rev 146
Line 98... Line 98...
98
	private function initialiserProjet() {
98
	private function initialiserProjet() {
99
		$this->chargerNomDuProjet();
99
		$this->chargerNomDuProjet();
100
		$this->chargerConfigProjet();
100
		$this->chargerConfigProjet();
Line 101... Line 101...
101
 
101
 
-
 
102
		// php5.3 : Enregistrement en première position des autoload de la méthode gérant les classes des services
-
 
103
		if (phpversion() < 5.3) {
-
 
104
			spl_autoload_register(array($this, 'chargerClasseProjet'));
102
		// php5.3 : Enregistrement en première position des autoload de la méthode gérant les classes des services
105
		} else {
-
 
106
			spl_autoload_register(array($this, 'chargerClasseProjet'), true , true);
103
		spl_autoload_register(array($this, 'chargerClasseProjet'), true , true);
107
		}
Line 104... Line 108...
104
	}
108
	}
105
 
109
 
106
	private function chargerNomDuProjet() {
110
	private function chargerNomDuProjet() {
Line 123... Line 127...
123
		$chemins[] = $this->cheminCourrant.'commun'.DS;
127
		$chemins[] = $this->cheminCourrant.'commun'.DS;
124
		$chemins[] = Config::get('chemin_bibliotheque');
128
		$chemins[] = Config::get('chemin_bibliotheque');
Line 125... Line 129...
125
 
129
 
126
		foreach ($chemins as $chemin) {
130
		foreach ($chemins as $chemin) {
127
			$chemin = $chemin.$classe.'.php';
-
 
128
			print_r($chemin);
131
			$chemin = $chemin.$classe.'.php';
129
			if (file_exists($chemin)) {
132
			if (file_exists($chemin)) {
130
				require_once $chemin;
133
				require_once $chemin;
131
			}
134
			}
132
		}
135
		}
Line 163... Line 166...
163
 
166
 
164
		$retour = '';
167
		$retour = '';
165
		$service = null;
168
		$service = null;
166
		foreach ($chemins as $chemin) {
169
		foreach ($chemins as $chemin) {
167
			if (file_exists($chemin)) {
-
 
168
				if (phpversion() < 5.3) {
-
 
169
					// L'option prepend de spl_autoload_register ne fonctionne pas avant php 5.3
-
 
170
					// TODO : améliorer ce comportement!
-
 
171
					require_once $chemin;
-
 
172
				}
170
			if (file_exists($chemin)) {
173
				$service = new $classe($this->getBdd());
171
				$service = new $classe($this->getBdd());
174
				$ressourcesPourService = $this->filtrerRessourcesPourService();
172
				$ressourcesPourService = $this->filtrerRessourcesPourService();
175
				$retour = $service->consulter($ressourcesPourService, $this->parametres);
173
				$retour = $service->consulter($ressourcesPourService, $this->parametres);
176
			}
174
			}