4 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
5 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnectorException.php';
35 $ilLog->write(__METHOD__ .
': Add new course url ...');
37 $this->path_postfix =
'/campusconnect/course_urls';
42 $this->
addHeader(
'Content-Type',
'application/json');
43 $this->
addHeader(
'Accept',
'application/json');
46 $this->curl->setOpt(CURLOPT_HTTPHEADER, $this->
getHeader());
47 $this->curl->setOpt(CURLOPT_POST,
true);
48 $this->curl->setOpt(CURLOPT_POSTFIELDS, json_encode($url));
50 $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ .
': Sending url ' . print_r(json_encode($url),
true));
54 $info = $this->curl->getInfo(CURLINFO_HTTP_CODE);
56 $ilLog->write(__METHOD__ .
': Checking HTTP status...');
57 if (
$info != self::HTTP_CODE_CREATED) {
58 $ilLog->write(__METHOD__ .
': Cannot create course url ressource, did not receive HTTP 201. ');
59 $ilLog->write(__METHOD__ .
': POST was: ' . json_encode($url));
60 $ilLog->write(__METHOD__ .
': HTTP code: ' .
$info);
63 $ilLog->write(__METHOD__ .
': ... got HTTP 201 (created)');
__construct(ilECSSetting $settings=null)
Constructor.
addUrl(ilECSCourseUrl $url, $a_target_mid)
Send url of newly created courses to ecs.
Connector for writing ecs course urls.
Represents a ecs course url.
addHeader($a_name, $a_value)
Add Header.
prepareConnection()
prepare connection
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.