Skip to content

Commit 5b1b5b7

Browse files
committed
Fixed error from cli
1 parent 4ff460d commit 5b1b5b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Raven/Client.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ class Client extends Raven_Client
1313
{
1414
public function __construct()
1515
{
16-
$env = include $_SERVER['DOCUMENT_ROOT'] . '/../app/etc/env.php';
16+
$ravenDNS = null;
17+
$options = [ ];
1718

18-
$options = [];
19-
$ravenDNS = array_key_exists('raven_dns', $env) ? $env['raven_dns'] : null;
19+
if ( php_sapi_name() !== 'cli')
20+
{
21+
$env = include $_SERVER[ 'DOCUMENT_ROOT' ] . '/../app/etc/env.php';
22+
$ravenDNS = array_key_exists('raven_dns', $env) ? $env[ 'raven_dns' ] : null;
23+
}
2024

2125
parent::__construct($ravenDNS, $options);
2226
}

0 commit comments

Comments
 (0)