File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ PHP NEWS
55- Core:
66 . Fixed GH-11847 (DTrace enabled build is broken). (Filip Zrůst)
77
8+ - FPM:
9+ . Fixed GH-12077 (PHP 8.3.0RC1 borked socket-close-on-exec.phpt).
10+ (Jakub Zelenka)
11+
81231 Aug 2023, PHP 8.3.0RC1
913
1014- Core:
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ FPM: Set CLOEXEC on the listen and connection socket
33--SKIPIF--
44<?php
55require_once "skipif.inc " ;
6- FPM \Tester::skipIfShellCommandFails ('lsof -v 2> /dev/null ' );
6+ FPM \Tester::skipIfShellCommandFails ('lsof -v ' , ' lsof-org/lsof ' );
77?>
88--FILE--
99<?php
Original file line number Diff line number Diff line change @@ -342,12 +342,24 @@ class Tester
342342 * Skip test if supplied shell command fails.
343343 *
344344 * @param string $command
345+ * @param string|null $expectedPartOfOutput
345346 */
346- static public function skipIfShellCommandFails ($ command )
347+ static public function skipIfShellCommandFails (string $ command, string $ expectedPartOfOutput = null )
347348 {
348- $ output = system ($ command , $ code );
349- if ($ code ) {
350- die ("skip command ' $ command' faield with code $ code and output: $ output " );
349+ $ result = exec ("$ command 2>&1 " , $ output , $ code );
350+ if ($ result === false || $ code ) {
351+ die ("skip command ' $ command' faieled with code $ code " );
352+ }
353+ if (!is_null ($ expectedPartOfOutput )) {
354+ if (is_array ($ output )) {
355+ foreach ($ output as $ line ) {
356+ if (str_contains ($ line , $ expectedPartOfOutput )) {
357+ // string found so no need to skip
358+ return ;
359+ }
360+ }
361+ }
362+ die ("skip command ' $ command' did not contain output ' $ expectedPartOfOutput' " );
351363 }
352364 }
353365
You can’t perform that action at this time.
0 commit comments