r39072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39071‎ | r39072 | r39073 >
Date:16:19, 10 August 2008
Author:demon
Status:old
Tags:
Comment:
Use wfMkdirParents() because it's cooler (and mkdir() would've failed on parent directory creation without the 'recursive' flag). Also removed an icky hardcoded directory mode. Sadly, this does not fix bug 15108 :p
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -572,6 +572,12 @@
573573 /** To override default SQLite data directory ($docroot/../data) */
574574 $wgSQLiteDataDir = '';
575575
 576+/** Default directory mode for SQLite data directory on creation.
 577+ * Note that this is different from the default directory mode used
 578+ * elsewhere.
 579+ */
 580+$wgSQLiteDataDirMode = 0700;
 581+
576582 /**
577583 * Make all database connections secretly go to localhost. Fool the load balancer
578584 * thinking there is an arbitrarily large cluster of servers to connect to.
Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -20,9 +20,9 @@
2121 * Constructor
2222 */
2323 function __construct($server = false, $user = false, $password = false, $dbName = false, $failFunction = false, $flags = 0) {
24 - global $wgOut,$wgSQLiteDataDir;
 24+ global $wgOut,$wgSQLiteDataDir, $wgSQLiteDataDirMode;
2525 if ("$wgSQLiteDataDir" == '') $wgSQLiteDataDir = dirname($_SERVER['DOCUMENT_ROOT']).'/data';
26 - if (!is_dir($wgSQLiteDataDir)) mkdir($wgSQLiteDataDir,0700);
 26+ if (!is_dir($wgSQLiteDataDir)) wfMkdirParents( $wgSQLiteDataDir, $wgSQLiteDataDirMode );
2727 if (!isset($wgOut)) $wgOut = NULL; # Can't get a reference if it hasn't been set yet
2828 $this->mOut =& $wgOut;
2929 $this->mFailFunction = $failFunction;
Index: trunk/phase3/RELEASE-NOTES
@@ -28,6 +28,9 @@
2929 * (bug 15080) $wgOverrideSiteFeed has been added. Setting either
3030 $wgSiteFeed['rss'] or 'atom' to a URL will override the default Recent Changes
3131 feed that appears on all pages.
 32+* $wgSQLiteDataDirMode has been introduced as the default directory mode for
 33+ SQLite data directories on creation. Note this setting is separate from
 34+ $wgDirectoryMode, which applies to all normal directories created by MediaWiki.
3235
3336 === New features in 1.14 ===
3437

Status & tagging log