Skip to content

Commit 706ecf5

Browse files
committed
Enable passing optional baseUrl and the secret in the BigBlueButton class.
1 parent c783d47 commit 706ecf5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/BigBlueButton.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,17 @@ class BigBlueButton
6161
protected $urlBuilder;
6262
protected $jSessionId;
6363

64-
public function __construct()
64+
/**
65+
* BigBlueButton constructor.
66+
* @param null $baseUrl
67+
* @param null $secret
68+
*/
69+
public function __construct($baseUrl = null, $secret = null)
6570
{
6671
// Keeping backward compatibility with older deployed versions
67-
$this->securitySecret = (getenv('BBB_SECURITY_SALT') === false) ? getenv('BBB_SECRET') : $this->securitySecret = getenv('BBB_SECURITY_SALT');
68-
$this->bbbServerBaseUrl = getenv('BBB_SERVER_BASE_URL');
72+
// BBB_SECRET is the new variable name and have higher priority against the old named BBB_SECURITY_SALT
73+
$this->securitySecret = $secret ?: getenv('BBB_SECRET') ?: getenv('BBB_SECURITY_SALT');
74+
$this->bbbServerBaseUrl = $baseUrl ?: getenv('BBB_SERVER_BASE_URL');
6975
$this->urlBuilder = new UrlBuilder($this->securitySecret, $this->bbbServerBaseUrl);
7076
}
7177

0 commit comments

Comments
 (0)