From ba7d16a4107f325a44f8eb4bf8ec34154d8df2f7 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sat, 22 Aug 2009 16:50:03 +0000 Subject: [PATCH] Merge r53381 from wmf-deployment. Throw more informational error on creation failure. --- includes/GlobalFunctions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 580b510b07..dcf8e8d8ef 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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; } /** -- 2.20.1