Skip to content

Commit

Permalink
Merge branch 'master' into move-all-enums
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelWei committed May 5, 2024
2 parents 69f46ef + 7f7320f commit 6e0cb9d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/BigBlueButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ class BigBlueButton
*/
public function __construct(?string $baseUrl = null, ?string $secret = null, ?TransportInterface $transport = null, string $hashingAlgorithm = HashingAlgorithm::SHA_1)
{
if (null === $baseUrl) {
@trigger_error(sprintf('Constructing "%s" without passing a server base URL is deprecated and will throw an exception 6.0.', self::class), \E_USER_DEPRECATED);
}

if (null === $secret) {
@trigger_error(sprintf('Constructing "%s" without passing a secret is deprecated and will throw an exception 6.0.', self::class), \E_USER_DEPRECATED);
}

if (getenv('BBB_SECURITY_SALT') !== false || getenv('BBB_SECRET') !== false) {
@trigger_error('Using BBB_SECURITY_SALT or BBB_SECRET environment variables is deprecated for security reasons and will be removed in 6.0. Use the constructor parameters instead.', \E_USER_DEPRECATED);
}

if (getenv('BBB_SERVER_BASE_URL') !== false) {
@trigger_error('Using BBB_SERVER_BASE_URL environment variable is deprecated for security reasons and will be removed in 6.0. Use the constructor parameters instead.', \E_USER_DEPRECATED);
}

// Keeping backward compatibility with older deployed versions
$this->securitySecret = $secret ?: getenv('BBB_SECURITY_SALT') ?: getenv('BBB_SECRET');
$this->bbbServerBaseUrl = $baseUrl ?: getenv('BBB_SERVER_BASE_URL');
Expand Down

0 comments on commit 6e0cb9d

Please sign in to comment.