Skip to content

Commit

Permalink
Merge pull request bigbluebutton#171 from denis-b/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tothetop430 authored Jan 24, 2022
2 parents f6ba9f9 + 09999b9 commit eb537a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/BigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ class BigBlueButton
* @param null $baseUrl
* @param null $secret
*/
public function __construct($baseUrl = null, $secret = null)
public function __construct($baseUrl = null, $secret = null, $opts = null)
{
// Keeping backward compatibility with older deployed versions
// BBB_SECRET is the new variable name and have higher priority against the old named BBB_SECURITY_SALT
$this->securitySecret = $secret ?: getenv('BBB_SECRET') ?: getenv('BBB_SECURITY_SALT');
$this->bbbServerBaseUrl = $baseUrl ?: getenv('BBB_SERVER_BASE_URL');
$this->urlBuilder = new UrlBuilder($this->securitySecret, $this->bbbServerBaseUrl);
$this->curlopts = $opts['curl'] ?? [];
}

/**
Expand Down Expand Up @@ -396,6 +397,14 @@ public function setJSessionId($jSessionId)
$this->jSessionId = $jSessionId;
}

/**
* @param array $curlopts
*/
public function setCurlOpts($curlopts)
{
$this->curlopts = $curlopts;
}

/* ____________________ INTERNAL CLASS METHODS ___________________ */

/**
Expand All @@ -420,6 +429,9 @@ private function processXmlResponse($url, $payload = '', $contentType = 'applica
$cookiefile = tmpfile();
$cookiefilepath = stream_get_meta_data($cookiefile)['uri'];

foreach ($this->curlopts as $opt => $value){
curl_setopt($ch, $opt, $value);
}
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
curl_setopt($ch, CURLOPT_URL, $url);
Expand Down

0 comments on commit eb537a7

Please sign in to comment.