
tstarling at wikimedia
Jul 18, 2008, 12:57 AM
Post #2 of 2
(364 views)
Permalink
|
|
Re: [MediaWiki-CVS] SVN: [37787] trunk/phase3/includes
[In reply to]
|
|
Simetrical wrote: > On Thu, Jul 17, 2008 at 8:19 AM, <werdna[at]svn.wikimedia.org> wrote: >> + $h = popen( $cmd, 'r' ); >> + >> + $diff = ''; >> + >> + do { >> + $data = fread( $h, 8192 ); >> + if ( strlen( $data ) == 0 ) { >> + break; >> + } >> + $diff .= $data; >> + } while ( true ); >> + >> + // Clean up >> + pclose( $h ); >> . . . >> + $diff_lines = explode( "\n", $diff ); > > Couldn't all this be replaced with the following? > > $diff_lines = array(); > exec( $cmd, $diff_lines ); No, use wfShellExec(). All of PHP's exec functions are broken on Windows and need some hacky workarounds. Also note that exec() will strip trailing whitespace from each line and thus corrupt the diff. -- Tim Starling _______________________________________________ Wikitech-l mailing list Wikitech-l[at]lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
|