Skip to content

Commit 895ba21

Browse files
AndrewKostkadati18
authored andcommitted
Redirect stderr to stdout in original proc_open() command
1 parent a6dbae1 commit 895ba21

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

dist-persist/wbstack/src/Internal/PreApiWbStackUpdate.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function execute() {
1818
// Run update.php
1919
$domain = $GLOBALS[WBSTACK_INFO_GLOBAL]->requestDomain;
2020
$mwPath = realpath( __DIR__ . '/../../../' );
21-
$cmd = 'WBS_DOMAIN=' . $domain . ' php ' . $mwPath . '/maintenance/update.php --quick';
21+
$cmd = 'WBS_DOMAIN=' . $domain . ' php ' . $mwPath . '/maintenance/update.php --quick 2>&1';
2222

2323
$stdout = fopen( 'php://stdout', 'w' );
2424

@@ -42,12 +42,6 @@ public function execute() {
4242
array_push( $out, $line );
4343
}
4444

45-
while( $line = fgets( $stderrProc ) ) {
46-
$line = rtrim( $line );
47-
fwrite( $stdout, $line . PHP_EOL ); // effectively redirecting stdErr to stdOut
48-
array_push( $out, $line );
49-
}
50-
5145
fclose( $stdinProc );
5246
fclose( $stdoutProc );
5347
fclose( $stderrProc );

dist/wbstack/src/Internal/PreApiWbStackUpdate.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function execute() {
1818
// Run update.php
1919
$domain = $GLOBALS[WBSTACK_INFO_GLOBAL]->requestDomain;
2020
$mwPath = realpath( __DIR__ . '/../../../' );
21-
$cmd = 'WBS_DOMAIN=' . $domain . ' php ' . $mwPath . '/maintenance/update.php --quick';
21+
$cmd = 'WBS_DOMAIN=' . $domain . ' php ' . $mwPath . '/maintenance/update.php --quick 2>&1';
2222

2323
$stdout = fopen( 'php://stdout', 'w' );
2424

@@ -42,12 +42,6 @@ public function execute() {
4242
array_push( $out, $line );
4343
}
4444

45-
while( $line = fgets( $stderrProc ) ) {
46-
$line = rtrim( $line );
47-
fwrite( $stdout, $line . PHP_EOL ); // effectively redirecting stdErr to stdOut
48-
array_push( $out, $line );
49-
}
50-
5145
fclose( $stdinProc );
5246
fclose( $stdoutProc );
5347
fclose( $stderrProc );

0 commit comments

Comments
 (0)