r55667 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55666‎ | r55667 | r55668 >
Date:12:05, 29 August 2009
Author:demon
Status:deferred
Tags:
Comment:
* Expose $wgSQLiteDataDirMode at install time, use this value when creating directory.
* Normalize SQLite paths using DIRECTORY_SEPARATOR so windows people don't get confused
* Comment out $wgDeletedDirectory until Tim implements this so I can avoid the notices
Modified paths:
  • /branches/new-installer/phase3/includes/installer/Installer.php (modified) (history)
  • /branches/new-installer/phase3/includes/installer/SqliteInstaller.php (modified) (history)
  • /branches/new-installer/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/includes/installer/Installer.php
@@ -29,7 +29,7 @@
3030 'wgScriptPath',
3131 'wgScriptExtension',
3232 'wgMetaNamespace',
33 - 'wgDeletedDirectory',
 33+// 'wgDeletedDirectory',
3434 'wgEnableUploads',
3535 'wgLogo',
3636 );
Index: branches/new-installer/phase3/includes/installer/SqliteInstaller.php
@@ -3,7 +3,8 @@
44 class SqliteInstaller extends InstallerDBType {
55 var $globalNames = array(
66 'wgDBname',
7 - 'wgSQLiteDataDir'
 7+ 'wgSQLiteDataDir',
 8+ 'wgSQLiteDataDirMode',
89 );
910
1011 function getName() {
@@ -20,7 +21,12 @@
2122
2223 function getGlobalDefaults() {
2324 if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
24 - return array( 'wgSQLiteDataDir' => dirname( $_SERVER['DOCUMENT_ROOT'] ) . '/data' );
 25+ $path = str_replace(
 26+ array( '/', '\\' ),
 27+ DIRECTORY_SEPARATOR,
 28+ dirname( $_SERVER['DOCUMENT_ROOT'] ) . '/data'
 29+ );
 30+ return array( 'wgSQLiteDataDir' => $path );
2531 } else {
2632 return array();
2733 }
@@ -31,19 +37,22 @@
3238 $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) .
3339 $this->parent->getHelpBox( 'config-sqlite-dir-help' ) .
3440 $this->getTextBox( 'wgDBname', 'config-db-name' ) .
35 - $this->parent->getHelpBox( 'config-sqlite-name-help' );
 41+ $this->parent->getHelpBox( 'config-sqlite-name-help' ) .
 42+ $this->getTextBox( 'wgSQLiteDataDirMode', 'config-sqlite-permissions' ) .
 43+ $this->parent->getHelpBox( 'config-sqlite-permissions-help' );
3644 }
3745
3846 function submitConnectForm() {
3947 global $wgSQLiteDataDirMode, $wgSQLiteDataDir;
40 - $newValues = $this->setVarsFromRequest( array( 'wgSQLiteDataDir', 'wgDBname' ) );
 48+ $newValues = $this->setVarsFromRequest( array( 'wgSQLiteDataDir', 'wgDBname', 'wgSQLiteDataDirMode' ) );
4149 $dir = $newValues['wgSQLiteDataDir'];
 50+ $mode = $newValues['wgSQLiteDataDir'];
4251 if ( !is_dir( $dir ) ) {
4352 if ( !is_writable( dirname( $dir ) ) ) {
4453 return Status::newFatal( 'config-sqlite-parent-unwritable', $dir, dirname( $dir ) );
4554 }
4655 wfSuppressWarnings();
47 - $ok = wfMkdirParents( $dir, $wgSQLiteDataDirMode );
 56+ $ok = wfMkdirParents( $dir, $mode );
4857 wfRestoreWarnings();
4958 if ( !$ok ) {
5059 return Status::newFatal( 'config-sqlite-mkdir-error', $dir );
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php
@@ -4167,6 +4167,9 @@
41684168 'config-sqlite-dir-help' => 'SQLite stores table data into files in the filesystem.
41694169 This directory must be writable by the webserver.
41704170 It should <strong>not</strong> accessible via the web.',
 4171+'config-sqlite-permissions' => 'Permission for data directory:',
 4172+'config-sqlite-permissions-help' => 'Please specify the default permissions for the data directory.
 4173+If you don\'t know, it\'s probably safe to leave the default.',
41714174 'config-type-mysql' => 'MySQL',
41724175 'config-type-postgres' => 'PostgreSQL',
41734176 'config-type-sqlite' => 'SQLite',

Status & tagging log