Fix missing constant for PHP_SDK_PATH

This commit is contained in:
crazywhalecc
2024-10-03 10:44:49 +08:00
committed by Jerry Ma
parent 1ce3c1bc47
commit c841ef5b9a
5 changed files with 9 additions and 9 deletions

View File

@@ -37,10 +37,10 @@ class WindowsToolCheckList
#[AsCheckItem('if php-sdk-binary-tools are downloaded', limit_os: 'Windows', level: 997)]
public function checkSDK(): ?CheckResult
{
if (!file_exists(PHP_SDK_PATH . DIRECTORY_SEPARATOR . 'phpsdk-starter.bat')) {
if (!file_exists(getenv('PHP_SDK_PATH') . DIRECTORY_SEPARATOR . 'phpsdk-starter.bat')) {
return CheckResult::fail('php-sdk-binary-tools not downloaded', 'install-php-sdk');
}
return CheckResult::ok(PHP_SDK_PATH);
return CheckResult::ok(getenv('PHP_SDK_PATH'));
}
#[AsCheckItem('if git associated command exists', limit_os: 'Windows', level: 996)]
@@ -81,8 +81,8 @@ class WindowsToolCheckList
public function installPhpSdk(): bool
{
try {
FileSystem::removeDir(PHP_SDK_PATH);
cmd(true)->exec('git.exe clone --depth 1 https://github.com/php/php-sdk-binary-tools.git ' . PHP_SDK_PATH);
FileSystem::removeDir(getenv('PHP_SDK_PATH'));
cmd(true)->exec('git.exe clone --depth 1 https://github.com/php/php-sdk-binary-tools.git ' . getenv('PHP_SDK_PATH'));
} catch (RuntimeException) {
return false;
}