mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-07 08:45:40 +08:00
Add support for package environment variables and path injection
This commit is contained in:
@@ -112,6 +112,17 @@ class GlobalEnvManager
|
||||
}
|
||||
}
|
||||
|
||||
public static function appendEnv(string $key, string $value): void
|
||||
{
|
||||
$existing = getenv($key);
|
||||
if ($existing !== false && $existing !== '') {
|
||||
$separator = SystemTarget::isUnix() ? ':' : ';';
|
||||
self::putenv("{$key}={$value}{$separator}{$existing}");
|
||||
} else {
|
||||
self::putenv("{$key}={$value}");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the toolchain after the environment variables are set.
|
||||
* The toolchain or environment availability check is done here.
|
||||
|
||||
Reference in New Issue
Block a user