Merge pull request #411 from dicobaja/patch/which-php

use `where` command for windows host
This commit is contained in:
iBNu Maksum 2025-03-20 15:37:30 +07:00 committed by GitHub
commit 655e0494d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,7 +146,8 @@ switch ($action) {
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
if (function_exists("shell_exec")) {
$php = trim(shell_exec('which php'));
$which = stripos(php_uname('s'), "Win") === 0 ? 'where' : 'which';
$php = trim(shell_exec("$which php"));
if (empty($php)) {
$php = 'php';
}