From: Chad Horohoe Date: Sun, 10 Aug 2008 16:19:09 +0000 (+0000) Subject: Use wfMkdirParents() because it's cooler (and mkdir() would've failed on parent direc... X-Git-Tag: 1.31.0-rc.0~45969 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=b7fd7de5bae68f315b391adfadf0890082e3844b;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b144477695..9302f347bf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2b884f1a49..7e80706cec 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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. diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 5299c68810..35212dd86d 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -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;