Skip to content

Commit 24b2c2d

Browse files
committed
Merge pull request communiteq#3 from kaltura/https_support
support HTTPs for Discourse API.
2 parents 26c8b51 + d02bb7d commit 24b2c2d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_once "lib/DiscourseAPI.php";
44

5-
$api = new DiscourseAPI("apitest.discoursehosting.net", "....");
5+
$api = new DiscourseAPI("apitest.discoursehosting.net", API_KEY, API_HOST_PROTOCOL);
66

77
// create user
88
$r = $api->createUser('John Doe', 'johndoe', '[email protected]', 'foobar!!');

lib/DiscourseAPI.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ class DiscourseAPI
2020
private $_apiKey = null;
2121
private $_dcHostname = null;
2222

23-
function __construct($dcHostname, $apiKey = null)
23+
function __construct($dcHostname, $apiKey = null, $protocol='http')
2424
{
25-
$this->_dcHostname = $dcHostname;
26-
$this->_apiKey = $apiKey;
25+
$this->_dcHostname = $dcHostname;
26+
$this->_apiKey = $apiKey;
27+
$this->_protocol=$protocol;
2728
}
2829

2930
private function _getRequest($reqString, $paramArray = null, $apiUser = 'system')

0 commit comments

Comments
 (0)