[DOC-CVS] [doc-base] master: Deprecated backtick operator with shell_exec() for PHP 8.5 (#267)
[email protected] (Louis-Arnaud via GitHub)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: alfsb
Date: 2025-12-10T13:14:24-03:00
Commit: https://github.com/php/doc-base/commit/6c203955560df759301d2dd745ed3f573a5a4432
Raw diff: https://github.com/php/doc-base/commit/6c203955560df759301d2dd745ed3f573a5a4432.diff
Deprecated backtick operator with shell_exec() for PHP 8.5 (#267)
* Replace deprecated backtick operator with shell_exec() for PHP 8.5 compatibility
Changed paths:
M configure.php
Diff:
diff --git a/configure.php b/configure.php
index 028604ada9..297a69e071 100755
--- a/configure.php
+++ b/configure.php
@@ -587,12 +587,12 @@ function find_xml_files($path) // {{{
foreach ( $repos as $name => $path )
{
$path = escapeshellarg( $path );
- $branch = trim( `git -C $path rev-parse --abbrev-ref HEAD` );
+ $branch = trim(shell_exec("git -C $path rev-parse --abbrev-ref HEAD"));
$suffix = $branch == "master" ? "" : " (branch $branch)";
$output .= str_pad( "$name:" , 10 );
- $output .= rtrim( `git -C $path rev-parse HEAD` ?? "" ) . "$suffix ";
- $output .= rtrim( `git -C $path for-each-ref --format="%(push:track)" refs/heads/$branch` ?? "" ) . "\n";
- $output .= rtrim( `git -C $path status -s` ?? "" ) . "\n";
+ $output .= rtrim(shell_exec("git -C $path rev-parse HEAD") ?? "") . "$suffix ";
+ $output .= rtrim(shell_exec("git -C $path for-each-ref --format=\"%(push:track)\" refs/heads/$branch") ?? "") . "\n";
+ $output .= rtrim(shell_exec("git -C $path status -s") ?? "") . "\n";
}
while( str_contains( $output , "\n\n" ) )
$output = str_replace( "\n\n" , "\n" , $output );