Skip to content

Commit 58633a0

Browse files
Only call putenv if we can
1 parent 9ca5644 commit 58633a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Loader.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,9 @@ public function setEnvironmentVariable($name, $value = null)
341341
apache_setenv($name, $value);
342342
}
343343

344-
putenv("$name=$value");
344+
if (function_exists('putenv')) {
345+
putenv("$name=$value");
346+
}
345347

346348
$_ENV[$name] = $value;
347349
$_SERVER[$name] = $value;
@@ -370,7 +372,9 @@ public function clearEnvironmentVariable($name)
370372
return;
371373
}
372374

373-
putenv($name);
375+
if (function_exists('putenv')) {
376+
putenv($name);
377+
}
374378

375379
unset($_ENV[$name], $_SERVER[$name]);
376380
}

0 commit comments

Comments
 (0)