Skip to content

Commit 8518a51

Browse files
committed
fix: Only opt out if user has not set BOLT_ANALYTICS_OPTOUT
1 parent 0f1d219 commit 8518a51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Bolt/ProtocolFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ class ProtocolFactory
3232
*/
3333
public function createProtocol(IConnection $connection, AuthenticateInterface $auth, string $userAgent): array
3434
{
35-
putenv('BOLT_ANALYTICS_OPTOUT=1');
35+
$boltOptoutEnv = getenv('BOLT_ANALYTICS_OPTOUT');
36+
/** @psalm-suppress RiskyTruthyFalsyComparison */
37+
if (empty($boltOptoutEnv)) {
38+
putenv('BOLT_ANALYTICS_OPTOUT=1');
39+
}
3640

3741
$bolt = new Bolt($connection);
3842
$bolt->setProtocolVersions(5.4, 5.3, 5, 4.4);

0 commit comments

Comments
 (0)