Use wfMkdirParents() because it's cooler (and mkdir() would've failed on parent direc...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 10 Aug 2008 16:19:09 +0000 (16:19 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 10 Aug 2008 16:19:09 +0000 (16:19 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/db/DatabaseSqlite.php

index b144477..9302f34 100644 (file)
@@ -28,6 +28,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 15080) $wgOverrideSiteFeed has been added. Setting either
   $wgSiteFeed['rss'] or 'atom' to a URL will override the default Recent Changes
   feed that appears on all pages.
+* $wgSQLiteDataDirMode has been introduced as the default directory mode for
+  SQLite data directories on creation. Note this setting is separate from
+  $wgDirectoryMode, which applies to all normal directories created by MediaWiki.
 
 === New features in 1.14 ===
 
index 2b884f1..7e80706 100644 (file)
@@ -572,6 +572,12 @@ $wgDBts2schema      = 'public';
 /** To override default SQLite data directory ($docroot/../data) */
 $wgSQLiteDataDir    = '';
 
+/** Default directory mode for SQLite data directory on creation.
+ *  Note that this is different from the default directory mode used
+ *  elsewhere.
+ */
+$wgSQLiteDataDirMode = 0700;
+
 /**
  * Make all database connections secretly go to localhost. Fool the load balancer
  * thinking there is an arbitrarily large cluster of servers to connect to.
index 5299c68..35212dd 100644 (file)
@@ -20,9 +20,9 @@ class DatabaseSqlite extends Database {
         * Constructor
         */
        function __construct($server = false, $user = false, $password = false, $dbName = false, $failFunction = false, $flags = 0) {
-               global $wgOut,$wgSQLiteDataDir;
+               global $wgOut,$wgSQLiteDataDir, $wgSQLiteDataDirMode;
                if ("$wgSQLiteDataDir" == '') $wgSQLiteDataDir = dirname($_SERVER['DOCUMENT_ROOT']).'/data';
-               if (!is_dir($wgSQLiteDataDir)) mkdir($wgSQLiteDataDir,0700);
+               if (!is_dir($wgSQLiteDataDir)) wfMkdirParents( $wgSQLiteDataDir, $wgSQLiteDataDirMode );
                if (!isset($wgOut)) $wgOut = NULL; # Can't get a reference if it hasn't been set yet
                $this->mOut =& $wgOut;
                $this->mFailFunction = $failFunction;