24 include_once(
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
71 $this->result_string = $a_res;
75 $this->header_parsing =
true;
90 $this->http_code = $a_code;
132 $this->headers = $a_headers;
142 return $this->headers ? $this->headers : array();
152 if ($this->header_parsing
and $this->result_string) {
158 switch ($this->result_type) {
159 case self::RESULT_TYPE_JSON:
160 if ($this->result_string) {
161 $this->result = json_decode($this->result_string);
163 $this->result = array();
167 case self::RESULT_TYPE_URL_LIST:
168 $this->result = $this->
parseUriList($this->result_string);
183 $pos = strpos($this->result_string,
"\r\n\r\n");
184 if ($pos !==
false) {
185 $this->result_header = substr($this->result_string, 0, $pos + 2);
186 $this->result_string = substr($this->result_string, $pos + 2, -1);
189 $this->log->write(__METHOD__ .
': Cannot find header entry');
203 $location_start = strpos($this->result_header,
"Location:");
204 if ($location_start !==
false) {
205 $location_start += 10;
206 $location_end = strpos($this->result_header,
"\r\n", $location_start);
208 $location = substr($this->result_header, $location_start, $location_end - $location_start);
212 $ecs_sender = strpos($this->result_header, self::HEADER_ECS_SENDER);
213 if ($ecs_sender !==
false) {
215 $sender_end = strpos($this->result_header,
"\r\n", $sender_start);
216 $sender = substr($this->result_header, $sender_start, $sender_end - $sender_start);
218 $senders_arr = explode(
',', $sender);
219 $this->header_map[self::HEADER_ECS_SENDER] = $senders_arr;
231 include_once
'Services/WebServices/ECS/classes/class.ilECSUriList.php';
234 foreach ($lines as $line) {
236 if (!strlen($line)) {
239 $uri_parts = explode(
"/", $line);
240 $list->add($line, array_pop($uri_parts));
const RESULT_TYPE_URL_LIST
if(isset($_REQUEST['delete'])) $list
parseHeader()
Parse header.
Presentation of ecs uril (http://...campusconnect/courselinks)
setHeaders($a_headers)
Set header.
getPlainResultString()
get unformated result string
__construct($a_res, $with_headers=false, $a_type=self::RESULT_TYPE_JSON)
Constructor.
setHTTPCode($a_code)
set HTTP return code
getHTTPCode()
get HTTP code
splitHeader()
Split header and content.
init()
init result (json_decode) private