r55575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55574‎ | r55575 | r55576 >
Date:15:47, 25 August 2009
Author:overlordq
Status:ok (Comments)
Tags:
Comment:
Followup to r52671, fix redirection syntax to work with windows as well.
Modified paths:
  • /trunk/phase3/includes/ProxyTools.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ProxyTools.php
@@ -174,7 +174,7 @@
175175 escapeshellarg( $port ),
176176 escapeshellarg( $url )
177177 ));
178 - exec( "php $params &>" . wfGetNull() . " &" );
 178+ exec( "php $params >" . wfGetNull() . " 2>&1 &" );
179179 }
180180 # Set MemCached key
181181 $wgMemc->set( $mcKey, 1, $wgProxyMemcExpiry );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r52671Use wfGetNull() instead of hardcoded /dev/nulldemon00:55, 2 July 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   17:36, 25 August 2009

I... think this works. :D

#Comment by Platonides (talk | contribs)   17:59, 25 August 2009

Note that the final & will be ignored, so the exec will block. You can test it with php "-rexec('sleep 5 >nul 2>&1 &');"

There doesn't seem to be a way to spawn in background from php without an external helper program.

#Comment by Bryan (talk | contribs)   19:36, 25 August 2009

pcntl_fork(); That won't work on windows, but on the other hand & will neither.

#Comment by Platonides (talk | contribs)   23:40, 25 August 2009

I don't think you will find many hosts with pcntl extension enabled.

#Comment by Catrope (talk | contribs)   22:46, 27 August 2009

Hmm, it does work on Ubuntu for both Michael and me. What distro are you using?

Status & tagging log