From 1c4c27d3d1c8e0e173282a9715dc4e10ae3fb6ba Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 15 Mar 2009 14:30:39 +0000 Subject: [PATCH] Add optional $caller param to wfMkdirParents(). Should make debugging mkdir() errors easier. --- includes/GlobalFunctions.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2605ad002f..2936a1e680 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1997,11 +1997,16 @@ function wfTempDir() { * * @param string $dir Full path to directory to create * @param int $mode Chmod value to use, default is $wgDirectoryMode + * @param string $caller Optional caller param for debugging. * @return bool */ -function wfMkdirParents( $dir, $mode = null ) { +function wfMkdirParents( $dir, $mode = null, $caller = null ) { global $wgDirectoryMode; + if ( !is_null( $caller ) ) { + wfDebug( "$caller: called wfMkdirParents($dir)" ); + } + if( strval( $dir ) === '' || file_exists( $dir ) ) return true; -- 2.20.1