Skip to content

Commit 39648c5

Browse files
fixed getting env vars
1 parent ed80871 commit 39648c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Bolt.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ final class Bolt
2626

2727
public function __construct(private IConnection $connection)
2828
{
29-
$_ENV['TEMP_DIR'] = getenv('TEMP') ?? getenv('TMPDIR') ?? (dirname(__DIR__) . DIRECTORY_SEPARATOR . 'temp');
29+
$_ENV['TEMP_DIR'] = getenv('TEMP') ?: getenv('TMPDIR') ?: (dirname(__DIR__) . DIRECTORY_SEPARATOR . 'temp');
30+
var_dump($_ENV['TEMP_DIR']);
3031
if (!file_exists($_ENV['TEMP_DIR'])) {
3132
mkdir($_ENV['TEMP_DIR'], recursive: true);
3233
}

tests/protocol/ProtocolLayer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function readCallback(int $length = 2048): string
100100
*/
101101
protected function setUp(): void
102102
{
103-
$_ENV['TEMP_DIR'] = getenv('TEMP') ?? getenv('TMPDIR') ?? (dirname(__DIR__) . DIRECTORY_SEPARATOR . 'temp');
103+
$_ENV['TEMP_DIR'] = getenv('TEMP') ?: getenv('TMPDIR') ?: (dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'temp');
104104
if (!file_exists($_ENV['TEMP_DIR'])) {
105105
mkdir($_ENV['TEMP_DIR'], recursive: true);
106106
}

0 commit comments

Comments
 (0)