From 183851b06bd6c52f3cae5375f433da720d410447 Mon Sep 17 00:00:00 2001
From: Pierre Schmitz
Date: Wed, 11 Oct 2006 18:12:39 +0000
Subject: MediaWiki 1.7.1 wiederhergestellt
---
config/index.php | 1665 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 1665 insertions(+)
create mode 100644 config/index.php
(limited to 'config/index.php')
diff --git a/config/index.php b/config/index.php
new file mode 100644
index 00000000..8fc91f8e
--- /dev/null
+++ b/config/index.php
@@ -0,0 +1,1665 @@
+, 2006 Rob Church
+# http://www.mediawiki.org/
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# http://www.gnu.org/copyleft/gpl.html
+
+error_reporting( E_ALL );
+header( "Content-type: text/html; charset=utf-8" );
+@ini_set( "display_errors", true );
+
+# In case of errors, let output be clean.
+$wgRequestTime = microtime( true );
+
+# Attempt to set up the include path, to fix problems with relative includes
+$IP = dirname( dirname( __FILE__ ) );
+define( 'MW_INSTALL_PATH', $IP );
+$sep = PATH_SEPARATOR;
+if( !ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" ) ) {
+ set_include_path( ".$sep$IP$sep$IP/includes$sep$IP/languages" );
+}
+
+# Define an entry point and include some files
+define( "MEDIAWIKI", true );
+define( "MEDIAWIKI_INSTALL", true );
+
+// Run version checks before including other files
+// so people don't see a scary parse error.
+require_once( "install-utils.inc" );
+install_version_checks();
+
+require_once( "includes/Defines.php" );
+require_once( "includes/DefaultSettings.php" );
+require_once( "includes/MagicWord.php" );
+require_once( "includes/Namespace.php" );
+
+## Databases we support:
+
+$ourdb = array();
+$ourdb['mysql']['fullname'] = 'MySQL';
+$ourdb['mysql']['havedriver'] = 0;
+$ourdb['mysql']['compile'] = 'mysql';
+$ourdb['mysql']['bgcolor'] = '#ffe5a7';
+
+$ourdb['postgres']['fullname'] = 'PostgreSQL';
+$ourdb['postgres']['havedriver'] = 0;
+$ourdb['postgres']['compile'] = 'pgsql';
+$ourdb['postgres']['bgcolor'] = '#aaccff';
+
+?>
+
+
+
+
+ MediaWiki Installation
+
+
+
+
+
+
+
+
+
+
+
MediaWiki Installation
+
+Setup has completed, your wiki is configured.
+
+
Please delete the /config directory for extra security.
In order to configure the wiki you have to make the config subdirectory
+ writable by the web server. Once configuration is done you'll move the created
+ LocalSettings.php to the parent directory, and for added safety you can
+ then remove the config subdirectory entirely.
+
+
To make the directory writable on a Unix/Linux system:
+ Warning:
+ PHP's register_globals option is enabled. Disable it if you can.
+
+ MediaWiki will work, but your server is more exposed to PHP-based security vulnerabilities.
+
+
Fatal: magic_quotes_runtime is active!
+ This option corrupts data input unpredictably; you cannot install or use
+ MediaWiki unless this option is disabled.
+
Fatal: magic_quotes_sybase is active!
+ This option corrupts data input unpredictably; you cannot install or use
+ MediaWiki unless this option is disabled.
+
Fatal: mbstring.func_overload is active!
+ This option causes errors and may corrupt data unpredictably;
+ you cannot install or use MediaWiki unless this option is disabled.
+
\n";
+} else {
+ dieout( "PHP's XML module is missing; the wiki requires functions in
+ this module and won't work in this configuration.
+ If you're running Mandrake, install the php-xml package." );
+}
+
+# Crude check for session support
+if( !function_exists( 'session_name' ) )
+ dieout( "PHP's session module is missing. MediaWiki requires session support in order to function." );
+
+# Likewise for PCRE
+if( !function_exists( 'preg_match' ) )
+ dieout( "The PCRE regular expression functions are missing. MediaWiki requires these in order to function." );
+
+$memlimit = ini_get( "memory_limit" );
+$conf->raiseMemory = false;
+if( empty( $memlimit ) || $memlimit == -1 ) {
+ print "
PHP is linked with old MySQL client libraries. If you are
+ using a MySQL 4.1 server and have problems connecting to the database,
+ see http://dev.mysql.com/doc/mysql/en/old-client.html for help.
\n";
+ }
+ $ok = true; # Let's be optimistic
+
+ # Decide if we're going to use the superuser or the regular database user
+ if( $conf->RootPW == '-' ) {
+ # Regular user
+ $conf->Root = false;
+ $db_user = $wgDBuser;
+ $db_pass = $wgDBpassword;
+ } else {
+ # Superuser
+ $conf->Root = true;
+ $db_user = $conf->RootUser;
+ $db_pass = $conf->RootPW;
+ }
+
+ # Attempt to connect
+ echo( "
Attempting to connect to database server as $db_user..." );
+ $wgDatabase = Database::newFromParams( $wgDBserver, $db_user, $db_pass, '', 1 );
+
+ # Check the connection and respond to errors
+ if( $wgDatabase->isOpen() ) {
+ # Seems OK
+ $ok = true;
+ $wgDBadminuser = $db_user;
+ $wgDBadminpassword = $db_pass;
+ echo( "success.
\n" );
+ $wgDatabase->ignoreErrors( true );
+ $myver = $wgDatabase->getServerVersion();
+ } else {
+ # There were errors, report them and back out
+ $ok = false;
+ $errno = mysql_errno();
+ $errtx = htmlspecialchars( mysql_error() );
+ switch( $errno ) {
+ case 1045:
+ case 2000:
+ echo( "failed due to authentication errors. Check passwords." );
+ if( $conf->Root ) {
+ # The superuser details are wrong
+ $errs["RootUser"] = "Check username";
+ $errs["RootPW"] = "and password";
+ } else {
+ # The regular user details are wrong
+ $errs["DBuser"] = "Check username";
+ $errs["DBpassword"] = "and password";
+ }
+ break;
+ case 2002:
+ case 2003:
+ default:
+ # General connection problem
+ echo( "failed with error [$errno] $errtx.\n" );
+ $errs["DBserver"] = "Connection failed";
+ break;
+ } # switch
+ } #conn. att.
+
+ if( !$ok ) { continue; }
+
+ } else /* not mysql */ {
+ echo( "
Attempting to connect to database server as $wgDBuser..." );
+ $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1);
+ if (!$wgDatabase->isOpen()) {
+ print " error: " . $wgDatabase->lastError() . "
Creating tables...";
+ if ($conf->DBtype == 'mysql') {
+ if( $wgDBmysql5 ) {
+ print " using MySQL 5 table defs...";
+ dbsource( "../maintenance/mysql5/tables.sql", $wgDatabase );
+ } else {
+ print " using MySQL 4 table defs...";
+ dbsource( "../maintenance/tables.sql", $wgDatabase );
+ }
+ dbsource( "../maintenance/interwiki.sql", $wgDatabase );
+ } else if ($conf->DBtype == 'postgres') {
+ dbsource( "../maintenance/postgres/tables.sql", $wgDatabase );
+ $wgDatabase->update_interwiki();
+ } else if ($conf->DBtype == 'oracle') {
+ dbsource( "../maintenance/oracle/tables.sql", $wgDatabase );
+ dbsource( "../maintenance/oracle/interwiki.sql", $wgDatabase );
+ }
+ else {
+ $errs["DBtype"] = "Do not know how to handle database type '$conf->DBtype'";
+ continue;
+ }
+
+ print " done.
\n";
+
+ print "
Initializing data...";
+ $wgDatabase->insert( 'site_stats',
+ array( 'ss_row_id' => 1,
+ 'ss_total_views' => 0,
+ 'ss_total_edits' => 0,
+ 'ss_good_articles' => 0 ) );
+
+ # Set up the "regular user" account *if we can, and if we need to*
+ if( $conf->Root ) {
+ # See if we need to
+ $wgDatabase2 = $dbc->newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1 );
+ if( $wgDatabase2->isOpen() ) {
+ # Nope, just close the test connection and continue
+ $wgDatabase2->close();
+ echo( "
User $wgDBuser exists. Skipping grants.
" );
+ } else {
+ # Yes, so run the grants
+ echo( "
Granting user permissions to $wgDBuser on $wgDBname..." );
+ dbsource( "../maintenance/users.sql", $wgDatabase );
+ echo( "success.
If you are in a shared hosting environment, do not just move LocalSettings.php
+remotely. LocalSettings.php is currently owned by the user your webserver is running under,
+which means that anyone on the same server can read your database password! Downloading
+it and uploading it again will hopefully change the ownership to a user ID specific to you.
+EOT;
+ } else {
+ echo "
Installation successful! Move the config/LocalSettings.php file into the parent directory, then follow
+ this link to your wiki.
This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+
This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+
You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ or read it online