From 086ae52d12011746a75f5588e877347bc0457352 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 21 Mar 2008 11:49:34 +0100 Subject: Update auf MediaWiki 1.12.0 --- config/index.php | 63 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 20 deletions(-) (limited to 'config/index.php') diff --git a/config/index.php b/config/index.php index 0d08123e..556819df 100644 --- a/config/index.php +++ b/config/index.php @@ -325,7 +325,7 @@ foreach (array_keys($ourdb) AS $db) { } print "\n"; -if( ini_get( "register_globals" ) ) { +if( wfIniGetBool( "register_globals" ) ) { ?>
  • @@ -339,7 +339,7 @@ if( ini_get( "register_globals" ) ) { $fatal = false; -if( ini_get( "magic_quotes_runtime" ) ) { +if( wfIniGetBool( "magic_quotes_runtime" ) ) { $fatal = true; ?>
  • Fatal: magic_quotes_runtime is active! This option corrupts data input unpredictably; you cannot install or use @@ -347,7 +347,7 @@ if( ini_get( "magic_quotes_runtime" ) ) {
  • Fatal: magic_quotes_sybase is active! This option corrupts data input unpredictably; you cannot install or use @@ -355,7 +355,7 @@ if( ini_get( "magic_quotes_sybase" ) ) {
  • Fatal: mbstring.func_overload is active! This option causes errors and may corrupt data unpredictably; @@ -363,7 +363,7 @@ if( ini_get( "mbstring.func_overload" ) ) {
  • Fatal: zend.ze1_compatibility_mode is active! This option causes horrible bugs with MediaWiki; you cannot install or use @@ -376,7 +376,7 @@ if( $fatal ) { dieout( "

    Cannot install MediaWiki.

    " ); } -if( ini_get( "safe_mode" ) ) { +if( wfIniGetBool( "safe_mode" ) ) { $conf->safeMode = true; ?>
  • Warning: PHP's @@ -478,6 +478,8 @@ if ( $conf->eaccel ) { print "
  • eAccelerator installed
  • \n"; } +$conf->dba = function_exists( 'dba_open' ); + if( !( $conf->turck || $conf->eaccel || $conf->apc || $conf->xcache ) ) { echo( '
  • Couldn\'t find Turck MMCache, eAccelerator, @@ -514,7 +516,7 @@ $conf->ImageMagick = false; $imcheck = array( "/usr/bin", "/opt/csw/bin", "/usr/local/bin", "/sw/bin", "/opt/local/bin" ); foreach( $imcheck as $dir ) { $im = "$dir/convert"; - if( file_exists( $im ) ) { + if( @file_exists( $im ) ) { print "
  • Found ImageMagick: $im; image thumbnailing will be enabled if you enable uploads.
  • \n"; $conf->ImageMagick = $im; break; @@ -599,8 +601,8 @@ print "
  • Environment check /* Check for validity */ $errs = array(); -if( $conf->Sitename == "" || $conf->Sitename == "MediaWiki" || $conf->Sitename == "Mediawiki" ) { - $errs["Sitename"] = "Must not be blank or \"MediaWiki\""; +if( preg_match( '/^$|^mediawiki$|#/i', $conf->Sitename ) ) { + $errs["Sitename"] = "Must not be blank or \"MediaWiki\" and may not contain \"#\""; } if( $conf->DBuser == "" ) { $errs["DBuser"] = "Must not be blank"; @@ -751,6 +753,8 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $wgDBts2schema = $conf->DBts2schema; $wgCommandLineMode = true; + if (! defined ( 'STDERR' ) ) + define( 'STDERR', fopen("php://stderr", "wb")); $wgUseDatabaseMessages = false; /* FIXME: For database failure */ require_once( "$IP/includes/Setup.php" ); chdir( "config" ); @@ -839,6 +843,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { $errs["RootPW"] = "and password"; continue; } + $wgDatabase->initial_setup($conf->RootPW, 'postgres'); } echo( "
  • Attempting to connect to database \"$wgDBname\" as \"$wgDBuser\"..." ); $wgDatabase = $dbc->newFromParams($wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, 1); @@ -847,6 +852,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { } else { $myver = $wgDatabase->getServerVersion(); } + $wgDatabase->initial_setup('', $wgDBname); } if ( !$wgDatabase->isOpen() ) { @@ -1010,12 +1016,16 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print " done.
  • \n"; - print "
  • Initializing data...
  • \n"; + print "
  • Initializing statistics...
  • \n"; $wgDatabase->insert( 'site_stats', array ( 'ss_row_id' => 1, 'ss_total_views' => 0, - 'ss_total_edits' => 0, - 'ss_good_articles' => 0 ) ); + 'ss_total_edits' => 1, # Main page first edit + 'ss_good_articles' => 0, # Main page is not a good article - no internal link + 'ss_total_pages' => 1, # Main page + 'ss_users' => $conf->SysopName ? 1 : 0, # Sysop account, if created + 'ss_admins' => $conf->SysopName ? 1 : 0, # Sysop account, if created + 'ss_images' => 0 ) ); # Set up the "regular user" account *if we can, and if we need to* if( $conf->Root and $conf->DBtype == 'mysql') { @@ -1198,7 +1208,7 @@ if( count( $errs ) ) {

    - +
    • @@ -1223,6 +1233,11 @@ if( count( $errs ) ) { aField( $conf, "Shm", "eAccelerator", "radio", "eaccel" ); echo ""; } + if ( $conf->dba ) { + echo "
    • "; + aField( $conf, "Shm", "DBA (not recommended)", "radio", "dba" ); + echo "
    • "; + } ?>
    @@ -1234,6 +1249,9 @@ if( count( $errs ) ) {

    MediaWiki can also detect and support eAccelerator, Turck MMCache, APC, and XCache, but these should not be used if the wiki will be running on multiple application servers. +

    + DBA (Berkeley-style DB) is generally slower than using no cache at all, and is only + recommended for testing.

    @@ -1431,7 +1449,7 @@ window.onload = toggleDBarea('DBtype; ?>', /* -------------------------------------------------------------------------------------- */ function writeSuccessMessage() { $script = defined('MW_INSTALL_PHP5_EXT') ? 'index.php5' : 'index.php'; - if ( ini_get( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) { + if ( wfIniGetBool( 'safe_mode' ) && !ini_get( 'open_basedir' ) ) { echo <<

    Installation successful!

    @@ -1464,6 +1482,9 @@ EOT; function escapePhpString( $string ) { + if ( is_array( $string ) || is_object( $string ) ) { + return false; + } return strtr( $string, array( "\n" => "\\n", @@ -1494,6 +1515,10 @@ function writeLocalSettings( $conf ) { $cacheType = 'CACHE_ACCEL'; $mcservers = 'array()'; break; + case 'dba': + $cacheType = 'CACHE_DBA'; + $mcservers = 'array()'; + break; default: $cacheType = 'CACHE_NONE'; $mcservers = 'array()'; @@ -1666,9 +1691,8 @@ if ( \$wgCommandLineMode ) { # When you make changes to this configuration file, this will make # sure that cached pages are cleared. -\$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) ); -\$wgCacheEpoch = max( \$wgCacheEpoch, \$configdate ); - "; ## End of setting the $localsettings string +\$wgCacheEpoch = max( \$wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) ); +"; ## End of setting the $localsettings string // Keep things in Unix line endings internally; // the system will write out as local text type. @@ -1790,7 +1814,7 @@ function locate_executable($loc, $names, $versioninfo = false) { foreach ($names as $name) { $command = "$loc".DIRECTORY_SEPARATOR."$name"; - if (file_exists($command)) { + if (@file_exists($command)) { if (!$versioninfo) return $command; @@ -1812,7 +1836,6 @@ function testMemcachedServer( $server ) { } if ( !$errstr && count( $hostport ) != 2 ) { $errstr = 'Please specify host and port'; - var_dump( $hostport ); } if ( !$errstr ) { list( $host, $port ) = $hostport; @@ -1910,7 +1933,7 @@ function printListItem( $item ) {
  • User's Guide
  • FAQ
  • -

    MediaWiki is Copyright © 2001-2007 by Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke and others.

    +

    MediaWiki is Copyright © 2001-2008 by Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, Erik Möller, Gabriel Wicke and others.

    -- cgit v1.2.3-54-g00ecf