Skip to content

Commit eb9ee70

Browse files
committed
feat: allow for global environment variables to be configured.
This leverages the existing `.valet-env.php` file capability, but just adds the Valet Home directory as a first-lookup location. So, now Valet will check for `.valet-env.php` in: - `~/.config/valet/` - then the current project folder
1 parent 9e15b3c commit eb9ee70

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cli/Valet/Drivers/ValetDriver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ protected function isActualFile($path) {
222222
*/
223223
public function loadServerEnvironmentVariables($sitePath, $siteName) {
224224
$varFilePath = "$sitePath/.valet-env.php";
225+
226+
if (!file_exists($varFilePath)) {
227+
$varFilePath = VALET_HOME_PATH . '/.valet-env.php';
228+
}
225229
if (!file_exists($varFilePath)) {
226230
return;
227231
}

0 commit comments

Comments
 (0)