Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 3 Rev 236
Line 29... Line 29...
29
 
29
 
30
	public function consulter($ressources, $parametres) {
30
	public function consulter($ressources, $parametres) {
31
		$this->url_liste_projet = Config::get('url_service_base').'commun/aide/projets';
31
		$this->url_liste_projet = Config::get('url_service_base').'commun/aide/projets';
32
		$this->projet = Config::get('nom_projet');
32
		$this->projet = Config::get('nom_projet');
33
		$this->traiterRessources($ressources);
33
		$this->traiterRessources($ressources);
34
		return $this->formerReponseHTTP(json_encode($this->table_retour));
34
		return $this->formerReponseHTTP($this->table_retour);
Line 35... Line 35...
35
	}
35
	}
Line 36... Line 36...
36
	
36
	
Line 52... Line 52...
52
			header("Content-Type: $mime");
52
			header("Content-Type: $mime");
53
		}
53
		}
54
		// Envoie de l'entête
54
		// Envoie de l'entête
55
		RestServeur::envoyerEnteteStatutHttp($this->entete_http);
55
		RestServeur::envoyerEnteteStatutHttp($this->entete_http);
56
		// Envoie du corps
56
		// Envoie du corps
57
		echo $this->corps_http;
57
		return $this->corps_http;
58
	}
58
	}
Line 59... Line 59...
59
		
59
		
60
	public function renvoyerErreur($e, $c) {
60
	public function renvoyerErreur($e, $c) {
61
		$this->entete_http = $e;
61
		$this->entete_http = $e;
Line 107... Line 107...
107
		$res_return = null;
107
		$res_return = null;
108
		$projet = str_replace('_', '-', $projet);
108
		$projet = str_replace('_', '-', $projet);
109
		$url = Config::get('url_service_base').$projet.'/aide';
109
		$url = Config::get('url_service_base').$projet.'/aide';
110
		$intitule = 'PROJET '.strtoupper($projet);
110
		$intitule = 'PROJET '.strtoupper($projet);
111
		$res = $this->consulterHref($url);
111
		$res = $this->consulterHref($url);
112
		//$res = $this->rest_client->consulter($url);
-
 
113
		//$entete = $this->rest_client->getReponseEntetes();
-
 
114
		if ($res) {
112
		if ($res) {
115
			$res_return = $res->$intitule;
113
			$res_return = $res->$intitule;
116
		}
114
		}
117
	/*	if (isset($entete['wrapper_data']) && $res != '') {
-
 
118
			$res = json_decode($res);
-
 
119
			if (!is_object($res)) print_r($res);
-
 
120
			else $res_return = $res->$intitule;
-
 
121
		} else {
-
 
122
			$e = 'Le service aide du projet '.$projet.' ne fonctionne pas et renvoie comme entête : '.$entete.' et comme résultat : '.$res;
-
 
123
			$this->renvoyerErreur(RestServeur::HTTP_CODE_MAUVAISE_REQUETE, $e);
-
 
124
		}*/
-
 
125
		return $res_return;
115
		return $res_return;
126
	}
116
	}
Line 127... Line 117...
127
	
117