r65706 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65705‎ | r65706 | r65707 >
Date:18:20, 30 April 2010
Author:avar
Status:ok
Tags:
Comment:
Use Installer::maybeGetWebserverPrimaryGroup() for SQLite's data directory

No longer advice the user to create a world-writable directory for
their database, as was recommended in r65697.
Modified paths:
  • /branches/new-installer/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /branches/new-installer/phase3/includes/installer/SqliteInstaller.php (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/includes/installer/Installer.i18n.php
@@ -227,11 +227,22 @@
228228 'config-sqlite-name-help' => 'Choose a name that identifies your wiki.
229229 Do not use spaces or hyphens.
230230 This will be used for the SQLite data file name.',
231 - 'config-sqlite-parent-unwritable' => 'Cannot create the data directory "$1" automatically, because the parent directory "$2" is not writable by the webserver.
 231+ 'config-sqlite-parent-unwritable-group' => 'Cannot create the data directory <code><nowiki>$1</nowiki></code>, because the parent directory <code><nowiki>$2</nowiki></code> is not writable by the webserver.
232232
233 -To make the directory on a Unix/Linux system:
 233+We\'ve determined the user your webserver is running as. Make the <code><nowiki>$3</nowiki></code>
 234+directory writable by it to continue. On a Unix/Linux system do:
 235+
234236 <pre>cd $2
235237 mkdir $3
 238+chgrp $4 $3
 239+chmod g+w $3</pre>',
 240+ 'config-sqlite-parent-unwritable-nogroup' => 'Cannot create the data directory <code><nowiki>$1</nowiki></code>, because the parent directory <code><nowiki>$2</nowiki></code> is not writable by the webserver.
 241+
 242+We couldn\'t determine the user your webserver is running as. Make the <code><nowiki>$3</nowiki></code>
 243+directory globally writable by it (and others!) to continue. On a Unix/Linux system do:
 244+
 245+<pre>cd $2
 246+mkdir $3
236247 chmod a+w $3</pre>',
237248 'config-sqlite-mkdir-error' => 'Error creating the data directory "$1".
238249 Check the location and try again.',
@@ -565,9 +576,6 @@
566577 'config-db-schema-help' => "De bovenstaande schema's kloppen meestal.
567578 Wijzig ze alleen als u weet dat u ze nodig hebt.",
568579 'config-sqlite-dir' => 'Gegevensmap voor SQLite:',
569 - 'config-sqlite-dir-help' => "SQLite slaat gegevens op in een bestand op het bestandssysteem.
570 -Deze map moet beschrijfbaar zijn door de webserver.
571 -De map mag '''niet''' via het web toegankelijk zijn.",
572580 'config-type-mysql' => 'MySQL',
573581 'config-type-postgres' => 'PostgreSQL',
574582 'config-type-sqlite' => 'SQLite',
Index: branches/new-installer/phase3/includes/installer/SqliteInstaller.php
@@ -46,7 +46,12 @@
4747 $this->setVar( 'wgSQLiteDataDir', $dir );
4848 if ( !is_dir( $dir ) ) {
4949 if ( !is_writable( dirname( $dir ) ) ) {
50 - return Status::newFatal( 'config-sqlite-parent-unwritable', $dir, dirname( $dir ), basename( $dir ) );
 50+ $webserverGroup = Installer::maybeGetWebserverPrimaryGroup();
 51+ if ( $webserverGroup !== null ) {
 52+ return Status::newFatal( 'config-sqlite-parent-unwritable-group', $dir, dirname( $dir ), basename( $dir ), $webserverGroup );
 53+ } else {
 54+ return Status::newFatal( 'config-sqlite-parent-unwritable-nogroup', $dir, dirname( $dir ), basename( $dir ) );
 55+ }
5156 }
5257 wfSuppressWarnings();
5358 $ok = wfMkdirParents( $dir, 0700 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65697Be more helpful when we can't create the `data' directory for SQLite...avar16:12, 30 April 2010

Status & tagging log