Add $wgDefaultDirectoryChmod, allows customizing the default chmod value. Set to...
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 16 Jul 2008 18:36:40 +0000 (18:36 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 16 Jul 2008 18:36:40 +0000 (18:36 +0000)
includes/DefaultSettings.php
includes/GlobalFunctions.php

index edf23ca..29e5232 100644 (file)
@@ -162,6 +162,11 @@ $wgTmpDirectory     = false; ///< defaults to "{$wgUploadDirectory}/tmp"
 $wgUploadBaseUrl    = "";
 /**@}*/
 
+/**
+ * Default value for chmoding of new directories.
+ */
+$wgDefaultDirectoryChmod = 0777;
+
 /**
  * New file storage paths; currently used only for deleted files.
  * Set it like this:
index 56a313f..8185a7f 100644 (file)
@@ -1709,12 +1709,22 @@ function wfTempDir() {
 
 /**
  * Make directory, and make all parent directories if they don't exist
+ * 
+ * @param string $fullDir Full path to directory to create
+ * @param int $mode Chmod value to use, default is $wgDefaultDirectoryChmod
+ * @return bool
  */
-function wfMkdirParents( $fullDir, $mode = 0777 ) {
+function wfMkdirParents( $fullDir, $mode = null ) {
+       global $wgDefaultDirectoryChmod;
        if( strval( $fullDir ) === '' )
                return true;
        if( file_exists( $fullDir ) )
                return true;
+       // If not defined or isn't an int, set to default
+       if ( !$mode || !is_int($mode) ) {
+               $mode = $wgDefaultDirectoryChmod;
+       }
+
 
        # Go back through the paths to find the first directory that exists
        $currentDir = $fullDir;