Cleanup to wfGetNull():
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 5 Dec 2008 17:25:22 +0000 (17:25 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 5 Dec 2008 17:25:22 +0000 (17:25 +0000)
* Add override in case /dev/null isn't accessible (bug 11009)
* Use wfGetNull() in ProxyTools rather than hardcoding it

RELEASE-NOTES
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/ProxyTools.php

index e94bf4c..23f61fc 100644 (file)
@@ -68,6 +68,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   and should still be used in code meant to be compatible with v1.13 or older.
 * MediaWiki can be forced to use private IPs forwarded by a proxy server by
   using $wgUsePrivateIPs.
+* (bug 11009) The null file (ie: /dev/null) can be configured with $wgNullFile. 
+  Useful for overriding if the normal file isn't accessible
 
 === Migrated extensions ===
 The following extensions are migrated into MediaWiki 1.14:
index f299ec6..06035d4 100644 (file)
@@ -169,6 +169,13 @@ $wgUploadBaseUrl    = "";
  */
 $wgDirectoryMode = 0777;
 
+/**
+ * Path to null output (/dev/null on *nix, NUL on Windows)
+ * Can be left unset unless you need to override it (ie:
+ * open_basedir won't let you hit /dev/null. See bug 11009)
+ */
+$wgNullFile = false;
+
 /**
  * New file storage paths; currently used only for deleted files.
  * Set it like this:
index 4430440..d99bf67 100644 (file)
@@ -2816,6 +2816,10 @@ function wfLoadExtensionMessages( $extensionName, $langcode = false ) {
  * @return string
  */
 function wfGetNull() {
+       global $wgNullFile;
+       if ( $wgNullFile ) {
+               return $wgNullFile;
+       }
        return wfIsWindows()
                ? 'NUL'
                : '/dev/null';
index 771fd57..e7c22f8 100644 (file)
@@ -166,7 +166,7 @@ function wfProxyCheck() {
                                                escapeshellarg( $port ),
                                                escapeshellarg( $url )
                                                ));
-                       exec( "php $params &>/dev/null &" );
+                       exec( "php $params &>" . wfGetNull() . " &" );
                }
                # Set MemCached key
                $wgMemc->set( $mcKey, 1, $wgProxyMemcExpiry );