File tree 3 files changed +21
-5
lines changed
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ PHP NEWS
5
5
- Core:
6
6
. Fixed GH-11847 (DTrace enabled build is broken). (Filip Zrůst)
7
7
8
+ - FPM:
9
+ . Fixed GH-12077 (PHP 8.3.0RC1 borked socket-close-on-exec.phpt).
10
+ (Jakub Zelenka)
11
+
8
12
31 Aug 2023, PHP 8.3.0RC1
9
13
10
14
- Core:
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ FPM: Set CLOEXEC on the listen and connection socket
3
3
--SKIPIF--
4
4
<?php
5
5
require_once "skipif.inc " ;
6
- FPM \Tester::skipIfShellCommandFails ('lsof -v 2> /dev/null ' );
6
+ FPM \Tester::skipIfShellCommandFails ('lsof -v ' , ' lsof-org/lsof ' );
7
7
?>
8
8
--FILE--
9
9
<?php
Original file line number Diff line number Diff line change @@ -342,12 +342,24 @@ class Tester
342
342
* Skip test if supplied shell command fails.
343
343
*
344
344
* @param string $command
345
+ * @param string|null $expectedPartOfOutput
345
346
*/
346
- static public function skipIfShellCommandFails ($ command )
347
+ static public function skipIfShellCommandFails (string $ command, string $ expectedPartOfOutput = null )
347
348
{
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' " );
351
363
}
352
364
}
353
365
You can’t perform that action at this time.
0 commit comments