From 04fbf066822462f7838e6c5a43faaf556474416f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Tue, 29 Sep 2026 14:16:33 -0300 Subject: [PATCH] Add support for phpX.Y bin name format This makes easier to run configure.php with a versioned PHP executable. Also removes php5* bin names, as PHP 5 is not supported. --- configure.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/configure.php b/configure.php index 65104fdf1a..cdf49bef1d 100755 --- a/configure.php +++ b/configure.php @@ -247,6 +247,18 @@ function find_xml_files($path) // {{{ } } // }}} +function find_php_bin_name(): string +{ + return find_file([ + 'php' . PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, + 'php', + 'cli/php', + 'php.exe', + 'php-cli.exe', + 'php-cgi.exe', + ]); +} + $srcdir = dirname(__FILE__); $workdir = $srcdir; $basedir = $srcdir; @@ -265,7 +277,6 @@ function find_xml_files($path) // {{{ // Settings {{{ $cygwin_php_bat = "{$srcdir}/../phpdoc-tools/php.bat"; -$php_bin_names = array('php', 'php5', 'cli/php', 'php.exe', 'php5.exe', 'php-cli.exe', 'php-cgi.exe'); // }}} $acd = array( // {{{ @@ -483,7 +494,7 @@ function find_xml_files($path) // {{{ checking("for PHP executable"); if ($ac['PHP'] == '' || $ac['PHP'] == 'no') { - $ac['PHP'] = find_file($php_bin_names); + $ac['PHP'] = find_php_bin_name(); } else if (file_exists($cygwin_php_bat)) { $ac['PHP'] = $cygwin_php_bat; }