Index: trunk/phase3/config/Installer.php |
— | — | @@ -628,7 +628,7 @@ |
629 | 629 | $conf->SysopName = importPost( "SysopName", "WikiSysop" ); |
630 | 630 | $conf->SysopPass = importPost( "SysopPass" ); |
631 | 631 | $conf->SysopPass2 = importPost( "SysopPass2" ); |
632 | | - $conf->RootUser = importPost( "RootUser", "root" ); |
| 632 | + $conf->RootUser = importPost( "RootUser" ); |
633 | 633 | $conf->RootPW = importPost( "RootPW", "" ); |
634 | 634 | $useRoot = importCheck( 'useroot', false ); |
635 | 635 | $conf->LanguageCode = importPost( "LanguageCode", "en" ); |
— | — | @@ -644,7 +644,7 @@ |
645 | 645 | $conf->DBpgschema = importPost( "DBpgschema", "mediawiki" ); |
646 | 646 | |
647 | 647 | ## SQLite specific |
648 | | - $conf->SQLiteDataDir = importPost( "SQLiteDataDir", "" ); |
| 648 | + $conf->SQLiteDataDir = importPost( "SQLiteDataDir", '../data' ); |
649 | 649 | |
650 | 650 | ## MSSQL specific |
651 | 651 | // We need a second field so it doesn't overwrite the MySQL one |
— | — | @@ -953,9 +953,7 @@ |
954 | 954 | if (is_callable(array($wgDatabase, 'initial_setup'))) $wgDatabase->initial_setup('', $wgDBname); |
955 | 955 | |
956 | 956 | } elseif ( $conf->DBtype == 'sqlite' ) { |
957 | | - if ("$wgSQLiteDataDir" == '') { |
958 | | - $wgSQLiteDataDir = dirname($_SERVER['DOCUMENT_ROOT']).'/data'; |
959 | | - } |
| 957 | + $wgSQLiteDataDir = $conf->SQLiteDataDir; |
960 | 958 | echo '<li>Attempting to connect to SQLite database at "' . |
961 | 959 | htmlspecialchars( $wgSQLiteDataDir ) . '": '; |
962 | 960 | if ( !is_dir( $wgSQLiteDataDir ) ) { |
— | — | @@ -1004,7 +1002,9 @@ |
1005 | 1003 | } else { |
1006 | 1004 | $myver = $wgDatabase->getServerVersion(); |
1007 | 1005 | } |
1008 | | - if (is_callable(array($wgDatabase, 'initial_setup'))) $wgDatabase->initial_setup('', $wgDBname); |
| 1006 | + if ( is_callable( array( $wgDatabase, 'initial_setup' ) ) ) { |
| 1007 | + $wgDatabase->initial_setup('', $wgDBname); |
| 1008 | + } |
1009 | 1009 | echo "ok</li>\n"; |
1010 | 1010 | } elseif ( $conf->DBtype == 'oracle' ) { |
1011 | 1011 | echo "<li>Attempting to connect to database \"" . htmlspecialchars( $wgDBname ) ."\"</li>"; |
— | — | @@ -1664,9 +1664,9 @@ |
1665 | 1665 | aField( $conf, "SQLiteDataDir", "SQLite data directory:" ); |
1666 | 1666 | ?></div> |
1667 | 1667 | <div class="config-desc"> |
1668 | | - <p>SQLite stores table data into files in the filesystem. |
1669 | | - If you do not provide an explicit path, a "data" directory in |
1670 | | - the parent of your document root will be used.</p> |
| 1668 | + <p>SQLite stores table data into files in the |
| 1669 | + filesystem. By default the path is the "data" |
| 1670 | + directory in your document root.</p> |
1671 | 1671 | |
1672 | 1672 | <p>This directory must exist and be writable by the web server.</p> |
1673 | 1673 | </div> |
— | — | @@ -1789,6 +1789,10 @@ |
1790 | 1790 | $convert = ($conf->ImageMagick ? $conf->ImageMagick : "/usr/bin/convert" ); |
1791 | 1791 | $rights = ($conf->RightsUrl) ? "" : "# "; |
1792 | 1792 | $hashedUploads = $conf->safeMode ? '' : '# '; |
| 1793 | + $sqliteDataDir = escapePhpString( realpath($conf->SQLiteDataDir) ); |
| 1794 | + if ( substr_compare( $conf->IP, $sqliteDataDir, 0 ) ) { |
| 1795 | + $sqliteDataDir = substr_replace( $sqliteDataDir, '$IP', 0, strlen($conf->IP) ); |
| 1796 | + } |
1793 | 1797 | |
1794 | 1798 | if ( $conf->ShellLocale ) { |
1795 | 1799 | $locale = ''; |
— | — | @@ -1881,7 +1885,7 @@ |
1882 | 1886 | } elseif( $conf->DBtype == 'sqlite' ) { |
1883 | 1887 | $dbsettings = |
1884 | 1888 | "# SQLite-specific settings |
1885 | | -\$wgSQLiteDataDir = \"{$slconf['SQLiteDataDir']}\";"; |
| 1889 | +\$wgSQLiteDataDir = \"{$sqliteDataDir}\";"; |
1886 | 1890 | } elseif( $conf->DBtype == 'mssql' ) { |
1887 | 1891 | $dbsettings = |
1888 | 1892 | "# MSSQL specific settings |