Merge r53381 from wmf-deployment. Throw more informational error on creation failure.
authorChad Horohoe <demon@users.mediawiki.org>
Sat, 22 Aug 2009 16:50:03 +0000 (16:50 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sat, 22 Aug 2009 16:50:03 +0000 (16:50 +0000)
includes/GlobalFunctions.php

index 580b510..dcf8e8d 100644 (file)
@@ -2074,7 +2074,12 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) {
        if ( is_null( $mode ) )
                $mode = $wgDirectoryMode;
 
-       return mkdir( $dir, $mode, true );  // PHP5 <3
+       $ok = mkdir( $dir, $mode, true );  // PHP5 <3
+       if( !$ok ) {
+               // PHP doesn't report the path in its warning message, so add our own to aid in diagnosis.
+               trigger_error( __FUNCTION__ . ": failed to mkdir \"$dir\" mode $mode", E_USER_WARNING );
+       }
+       return $ok;
 }
 
 /**