mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 18:05:36 +08:00
fix(windows): consolidate to single canonical strawberry-perl path
Per review: spc's pkg config, doctor, and MSVCToolchain all use
PKG_ROOT_PATH\strawberry-perl. The arch-suffixed strawberry-perl-{arch}-win
path was stale and shouldn't be juggled alongside it. Validate against the
one canonical pkg-root path, falling back to WindowsUtil::findCommand.
This commit is contained in:
@@ -24,13 +24,8 @@ class openssl
|
|||||||
{
|
{
|
||||||
if (SystemTarget::getTargetOS() === 'Windows') {
|
if (SystemTarget::getTargetOS() === 'Windows') {
|
||||||
global $argv;
|
global $argv;
|
||||||
$perl_path_native = PKG_ROOT_PATH . '\strawberry-perl-' . arch2gnu(php_uname('m')) . '-win\perl\bin\perl.exe';
|
$perl_path = PKG_ROOT_PATH . '\strawberry-perl\perl\bin\perl.exe';
|
||||||
$perl_path_doctor = PKG_ROOT_PATH . '\strawberry-perl\perl\bin\perl.exe';
|
$perl = file_exists($perl_path) ? $perl_path : WindowsUtil::findCommand('perl.exe');
|
||||||
$perl = match (true) {
|
|
||||||
file_exists($perl_path_native) => $perl_path_native,
|
|
||||||
file_exists($perl_path_doctor) => $perl_path_doctor,
|
|
||||||
default => WindowsUtil::findCommand('perl.exe'),
|
|
||||||
};
|
|
||||||
if ($perl === null) {
|
if ($perl === null) {
|
||||||
throw new EnvironmentException(
|
throw new EnvironmentException(
|
||||||
'You need to install perl first!',
|
'You need to install perl first!',
|
||||||
|
|||||||
Reference in New Issue
Block a user