24 include_once(
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
69 $this->result_string = $a_res;
73 $this->header_parsing =
true;
88 $this->http_code = $a_code;
130 $this->headers = $a_headers;
140 return $this->headers ? $this->headers :
array();
150 if ($this->header_parsing and $this->result_string) {
156 switch ($this->result_type) {
157 case self::RESULT_TYPE_JSON:
158 if ($this->result_string) {
159 $this->result = json_decode($this->result_string);
161 $this->result =
array();
165 case self::RESULT_TYPE_URL_LIST:
166 $this->result = $this->
parseUriList($this->result_string);
181 $pos = strpos($this->result_string,
"\r\n\r\n");
182 if ($pos !==
false) {
183 $this->result_header = substr($this->result_string, 0, $pos + 2);
184 $this->result_string = substr($this->result_string, $pos + 2, -1);
187 $this->log->write(__METHOD__ .
': Cannot find header entry');
201 $location_start = strpos($this->result_header,
"Location:");
202 if ($location_start !==
false) {
203 $location_start += 10;
204 $location_end = strpos($this->result_header,
"\r\n", $location_start);
206 $location = substr($this->result_header, $location_start, $location_end - $location_start);
210 $ecs_sender = strpos($this->result_header, self::HEADER_ECS_SENDER);
211 if ($ecs_sender !==
false) {
213 $sender_end = strpos($this->result_header,
"\r\n", $sender_start);
214 $sender = substr($this->result_header, $sender_start, $sender_end - $sender_start);
216 $senders_arr = explode(
',', $sender);
217 $this->header_map[self::HEADER_ECS_SENDER] = $senders_arr;
229 include_once
'Services/WebServices/ECS/classes/class.ilECSUriList.php';
232 foreach ($lines as $line) {
234 if (!strlen($line)) {
237 $uri_parts = explode(
"/", $line);
238 $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
Create styles array
The data for the language used.
getHTTPCode()
get HTTP code
splitHeader()
Split header and content.
init()
init result (json_decode) private