Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 713 Rev 3289
Line 54... Line 54...
54
	public function ajouter($url, Array $donnees) {
54
	public function ajouter($url, Array $donnees) {
55
		$retour = $this->envoyerRequete($url, 'PUT', $donnees);
55
		$retour = $this->envoyerRequete($url, 'PUT', $donnees);
56
		return $retour;
56
		return $retour;
57
	}
57
	}
Line 58... Line 58...
58
	
58
	
59
	public function modifier($url, Array $donnees) {
59
	public function modifier($url, Array $donnees) { 
60
		$retour = $this->envoyerRequete($url, 'POST', $donnees);
60
		$retour = $this->envoyerRequete($url, 'POST', $donnees);
61
		return $retour;
61
		return $retour;
Line 62... Line 62...
62
	}
62
	}
Line 78... Line 78...
78
			}
78
			}
79
			$contexte = stream_context_create(array(
79
			$contexte = stream_context_create(array(
80
				'http' => array(
80
				'http' => array(
81
      				'method' => $mode,
81
      				'method' => $mode,
82
					'header' => "Content-type: application/x-www-form-urlencoded\r\n",
82
					'header' => "Content-type: application/x-www-form-urlencoded\r\n",
83
      				'content' => http_build_query($donnees, null, self::HTTP_URL_REQUETE_SEPARATEUR))));
83
					'content' => http_build_query($donnees, null, self::HTTP_URL_REQUETE_SEPARATEUR))));
-
 
84
			
84
			$flux = @fopen($this->url, 'r', false, $contexte);
85
			$flux = fopen($this->url, 'r', false, $contexte);
85
			if (!$flux) {
86
			if (!$flux) {
86
				$this->reponse_entetes = $http_response_header;
87
				$this->reponse_entetes = $http_response_header;
87
				$e = "L'ouverture de l'url '{$this->url}' par la méthode HTTP '$mode' a échoué!";
88
				$e = "L'ouverture de l'url '{$this->url}' par la méthode HTTP '$mode' a échoué!";
88
				trigger_error($e, E_USER_WARNING);
89
				trigger_error($e, E_USER_WARNING);
89
			} else {
90
			} else {