Subversion Repositories eFlore/Applications.del

Rev

Rev 1795 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1795 Rev 1813
Line 69... Line 69...
69
		$corps = $reponseHttp->getCorps();
69
		$corps = $reponseHttp->getCorps();
70
		return $corps;
70
		return $corps;
71
	}
71
	}
Line 72... Line 72...
72
 
72
 
73
	private function traiterRessources() {
-
 
74
		$this->chargerConfigService();
73
	private function traiterRessources() {
75
		$this->analyserRessources();
74
		$this->analyserRessources();
76
		$retour = $this->initialiserService();
75
		$retour = $this->initialiserService();
77
		return $retour;
76
		return $retour;
Line 78... Line -...
78
	}
-
 
79
 
-
 
80
	private function chargerConfigService() {
-
 
81
		$chemin = Config::get('chemin_configurations')."config_{$this->serviceNom}.ini";
-
 
82
		Config::charger($chemin);
-
 
83
	}
77
	}
84
 
78
 
85
	private function analyserRessources() {
79
	private function analyserRessources() {
86
		if ($this->methode == 'consulter') {
80
		if ($this->methode == 'consulter') {
87
			if ($this->ressources[0] == 'images-determinations-probables') {
81
			if ($this->ressources[0] == 'images-determinations-probables') {
Line 109... Line 103...
109
		throw new Exception($message, $code);
103
		throw new Exception($message, $code);
110
	}
104
	}
Line 111... Line 105...
111
 
105
 
112
	private function initialiserService() {
106
	private function initialiserService() {
113
		$classe = $this->obtenirNomClasseService($this->sousServiceNom);
-
 
114
		//echo $this->sousServiceNom.':'.$classe."\n";
-
 
115
		//echo 'Ressources :'.print_r($this->ressources, true);
-
 
116
		//echo 'Parametres :'.print_r($this->parametres, true);
107
		$classe = $this->obtenirNomClasseService($this->sousServiceNom);
117
		$chemins = array();
108
		$chemins = array();
118
		$chemins[] = $this->cheminCourant.$this->serviceNom.DS.$classe.'.php';
109
		$chemins[] = $this->cheminCourant.$this->serviceNom.DS.$classe.'.php';
119
		$chemins[] = $this->cheminCourant.'commun'.DS.$classe.'.php';
110
		$chemins[] = $this->cheminCourant.'commun'.DS.$classe.'.php';
120
		$retour = '';
111
		$retour = '';
121
		$service = null;
112
		$service = null;
122
		foreach ($chemins as $chemin) {
113
		foreach ($chemins as $chemin) {
123
			if (file_exists($chemin)) {
-
 
124
				$this->conteneur->chargerConfiguration('config_'.$this->serviceNom.'.ini');
114
			if (file_exists($chemin)) {
125
				require_once $chemin;
115
				require_once $chemin;
126
				$service = new $classe($this->conteneur);
116
				$service = new $classe($this->conteneur);
127
				if ($this->methode == 'consulter') {
117
				if ($this->methode == 'consulter') {
128
					$retour = $service->consulter($this->ressources, $this->parametres);
118
					$retour = $service->consulter($this->parametres);
129
				} elseif ($this->methode == 'ajouter') {
119
				} elseif ($this->methode == 'ajouter') {
130
					$retour = $service->ajouter($this->ressources, $this->parametres);
120
					$retour = $service->ajouter($this->ressources, $this->parametres);
131
				} elseif ($this->methode == 'modifier') {
121
				} elseif ($this->methode == 'modifier') {
132
					$retour = $service->modifier($this->ressources, $this->parametres);
122
					$retour = $service->modifier($this->ressources, $this->parametres);