Subversion Repositories eFlore/Applications.cel

Rev

Rev 908 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 908 Rev 946
Line 9... Line 9...
9
* @copyright	2010 Tela-Botanica
9
* @copyright	2010 Tela-Botanica
10
* @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
* @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
* @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
* @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
* @version		SVN: $Id$
12
* @version		SVN: $Id$
13
*/
13
*/
-
 
14
// TODO : remplacer les trigger_error par des exceptions qui pourrait ĂȘtre attrapĂ©es...
14
class CelRestClient {
15
class CelRestClient {
15
	const HTTP_URL_REQUETE_SEPARATEUR = '&';
16
	const HTTP_URL_REQUETE_SEPARATEUR = '&';
16
	const HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR = '=';
17
	const HTTP_URL_REQUETE_CLE_VALEUR_SEPARATEUR = '=';
17
	private $http_methodes = array('GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', 'TRACE');
18
	private $http_methodes = array('GET', 'POST', 'PUT', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', 'TRACE');
18
	protected $parametres = null;
19
	protected $parametres = null;
Line 120... Line 121...
120
	}
121
	}
Line 121... Line 122...
121
	
122
	
122
	private function analyserEntete() {
123
	private function analyserEntete() {
123
		$entetes = $this->reponse_entetes; 
124
		$entetes = $this->reponse_entetes; 
124
		$infos = array('date' => null, 'uri' => $this->url, 'debogages' => null);
-
 
-
 
125
		$infos = array('date' => null, 'uri' => $this->url, 'debogages' => null);
125
		
126
		if (isset($entetes)) {
126
		if (isset($entetes['wrapper_data'])) {
127
			if (isset($entetes['wrapper_data'])) {
127
			$entetes = $entetes['wrapper_data'];
128
				$entetes = $entetes['wrapper_data'];
128
		}
129
			}
129
		foreach ($entetes as $entete) {
130
			foreach ($entetes as $entete) {
Line 132... Line 133...
132
			}
133
				}
133
			if (preg_match('/^Date: .+ ([012][0-9]:[012345][0-9]:[012345][0-9]) .*$/', $entete, $match)) {
134
				if (preg_match('/^Date: .+ ([012][0-9]:[012345][0-9]:[012345][0-9]) .*$/', $entete, $match)) {
134
				$infos['date'] = $match[1];
135
					$infos['date'] = $match[1];
135
			}
136
				}
136
		}
137
			}
-
 
138
		}
137
		return $infos;
139
		return $infos;
138
	}
140
	}
Line 139... Line 141...
139
	
141
	
140
	private function traiterEnteteDebogage($entetes_analyses) {
142
	private function traiterEnteteDebogage($entetes_analyses) {