From 91c8c20ed47fadec4064ce8c3ef2741bc6bfc0a0 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 20 May 2004 12:46:31 +0000 Subject: [PATCH 01/16] we enable squid caching explicitly for pages that support it, mtime check didn't work anymore for some reason --- includes/OutputPage.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 00ec47fd66..7860a4228f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -83,10 +83,9 @@ class OutputPage { return; } - $lastmod = gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( - max( $timestamp, $wgUser->mTouched ) ) ) . " GMT"; + $lastmod = gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( max( $timestamp, $wgUser->mTouched ) ) ) . " GMT"; - if( !empty( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ) { + if( !empty( $_SERVER["HTTP_IF_MODIFIED_SINCE"] ) ) { # IE sends sizes after the date like this: # Wed, 20 Aug 2003 06:51:19 GMT; length=5202 # this breaks strtotime(). @@ -94,7 +93,7 @@ class OutputPage { $ismodsince = wfUnix2Timestamp( strtotime( $modsince ) ); wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false ); wfDebug( "-- we might send Last-Modified : $lastmod\n", false ); - + if( ($ismodsince >= $timestamp ) and $wgUser->validateCache( $ismodsince ) ) { # Make sure you're in a place you can leave when you call us! header( "HTTP/1.0 304 Not Modified" ); @@ -239,9 +238,9 @@ class OutputPage { global $wgUseSquid, $wgUseESI; # FIXME: This header may cause trouble with some versions of Internet Explorer header( "Vary: Accept-Encoding, Cookie" ); - if( $this->mEnableClientCache && $this->mLastModified != "" ) { + if( $this->mEnableClientCache ) { if( $wgUseSquid && ! isset( $_COOKIE[ini_get( "session.name") ] ) && - ! $this->isPrintable() ) + ! $this->isPrintable() && $this->mSquidMaxage != 0 ) { if ( $wgUseESI ) { # We'll purge the proxy cache explicitly, but require end user agents @@ -269,7 +268,7 @@ class OutputPage { header( "Expires: -1" ); header( "Cache-Control: private, must-revalidate, max-age=0" ); } - header( "Last-modified: {$this->mLastModified}" ); + if($this->mLastModified) header( "Last-modified: {$this->mLastModified}" ); } else { wfDebug( "** no caching **\n", false ); -- 2.20.1 From f76a3fc34b3cc97db9fbb4c6be807979e02ce27c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 20 May 2004 14:13:03 +0000 Subject: [PATCH 02/16] Fixing special pages, esp. dropdown list in the nostalgia skin --- includes/QueryPage.php | 9 ++++----- includes/Skin.php | 24 ++++++++---------------- includes/SpecialPage.php | 17 +++++++++++++++++ includes/SpecialSpecialpages.php | 18 ++++-------------- 4 files changed, 33 insertions(+), 35 deletions(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 5b68965c57..6ffd116623 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -8,8 +8,7 @@ require_once ( "Feed.php" ); class QueryPage { # Subclasses return their name here. Make sure the name is also - # specified in Language.php, both in the $wgValidSpecialPagesEn - # variable, and as a language message param. + # specified in SpecialPage.php and in Language.php as a language message param. function getName() { return ""; @@ -203,9 +202,9 @@ class QueryPage { function feedTitle() { global $wgLanguageCode, $wgSitename, $wgLang; - $pages = $wgLang->getValidSpecialPages(); - $title = $pages[$this->getName()]; - return "$wgSitename - $title [$wgLanguageCode]"; + $page = SpecialPage::getPage( $this->getName() ); + $desc = $page->getDescription(); + return "$wgSitename - $desc [$wgLanguageCode]"; } function feedDesc() { diff --git a/includes/Skin.php b/includes/Skin.php index 336a868c58..91faf5b5d5 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1033,29 +1033,21 @@ class Skin { { global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript; $a = array(); - - $validSP = $wgLang->getValidSpecialPages(); - - foreach ( $validSP as $name => $desc ) { - if ( "" == $desc ) { continue; } - $a[$name] = $desc; + $pages = SpecialPage::getPages(); + + foreach ( $pages[""] as $name => $page ) { + $a[$name] = $page->getDescription(); } if ( $wgUser->isSysop() ) { - $sysopSP = $wgLang->getSysopSpecialPages(); - - foreach ( $sysopSP as $name => $desc ) { - if ( "" == $desc ) { continue; } - $a[$name] = $desc ; + foreach ( $pages["sysop"] as $name => $page ) { + $a[$name] = $page->getDescription(); } } if ( $wgUser->isDeveloper() ) { - $devSP = $wgLang->getDeveloperSpecialPages(); - - foreach ( $devSP as $name => $desc ) { - if ( "" == $desc ) { continue; } - $a[$name] = $desc ; + foreach ( $pages["developer"] as $name => $page ) { + $a[$name] = $page->getDescription() ; } } $go = wfMsg( "go" ); diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 01e71858a6..6d131e12a6 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -68,6 +68,23 @@ class SpecialPage } } + # Return categorised listable special pages + /* static */ function getPages() { + global $wgSpecialPages; + $pages = array( + "" => array(), + "sysop" => array(), + "developer" => array() + ); + + foreach ( $wgSpecialPages as $name => $page ) { + if ( $page->isListed() ) { + $pages[$page->getRestriction()][$page->getName()] =& $wgSpecialPages[$name]; + } + } + return $pages; + } + # Execute a special page path, which may contain slashes /* static */ function executePath( &$title ) { global $wgSpecialPages, $wgOut, $wgTitle; diff --git a/includes/SpecialSpecialpages.php b/includes/SpecialSpecialpages.php index 094ae61388..e60910f83a 100644 --- a/includes/SpecialSpecialpages.php +++ b/includes/SpecialSpecialpages.php @@ -2,23 +2,13 @@ function wfSpecialSpecialpages() { - global $wgLang, $wgOut, $wgUser, $wgSpecialPages; + global $wgLang, $wgOut, $wgUser; $wgOut->setRobotpolicy( "index,nofollow" ); $sk = $wgUser->getSkin(); - - # Categorise special pages - - $pages = array( - "" => array(), - "sysop" => array(), - "developer" => array() - ); - - foreach ( $wgSpecialPages as $page ) { - $pages[$page->getRestriction()][$page->getName()] = $page; - } - + + # Get listable pages + $pages = SpecialPage::getPages(); # all users special pages wfSpecialSpecialpages_gen($pages[""],"spheading",$sk); -- 2.20.1 From 94d88c03b9226a74f0194b4950f6a4da45d01e44 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 20 May 2004 19:45:45 +0000 Subject: [PATCH 03/16] match spam against this-\>textbox1 --- includes/EditPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index e75b92252a..d359255f50 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -130,7 +130,7 @@ class EditPage { if ( "save" == $formtype ) { # Check for spam - if ( $wgSpamRegex && preg_match( $wgSpamRegex, $wpTextbox1 ) ) { + if ( preg_match( $wgSpamRegex, $this->textbox1 ) ) { sleep(10); $wgOut->redirect( $this->mTitle->getFullURL() ); return; -- 2.20.1 From 680704d114e4aa787c7a2431653ed9f2cb52415e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Thu, 20 May 2004 19:51:41 +0000 Subject: [PATCH 04/16] accidentially removed the test for --- includes/EditPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index d359255f50..d9959ae39f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -130,7 +130,7 @@ class EditPage { if ( "save" == $formtype ) { # Check for spam - if ( preg_match( $wgSpamRegex, $this->textbox1 ) ) { + if ( $wgSpamRegex && preg_match( $wgSpamRegex, $this->textbox1 ) ) { sleep(10); $wgOut->redirect( $this->mTitle->getFullURL() ); return; -- 2.20.1 From 8e24b884598ac435c0b76ab8ec85bbd8ec36c802 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 21 May 2004 00:57:17 +0000 Subject: [PATCH 05/16] bug fix --- includes/SpecialPage.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 6d131e12a6..5b013bffe1 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -146,6 +146,7 @@ class SpecialPage } function displayRestrictionError() { + global $wgOut; if ( $this->mRestriction == "developer" ) { $wgOut->developerRequired(); } else { -- 2.20.1 From c5f605766768e1b80f292a839e300d7084fe929e Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 21 May 2004 09:17:32 +0000 Subject: [PATCH 06/16] moved minor edit character to start of edit comment, makes the column layout more robust. Tried all sorts of things to make it work with M at front in IE5, but no luck. --- stylesheets/common.css | 15 ++++++--------- stylesheets/common_rtl.css | 5 +++++ stylesheets/monobook/main.css | 13 +++++-------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/stylesheets/common.css b/stylesheets/common.css index 1d7d5455a8..712e4fe78a 100644 --- a/stylesheets/common.css +++ b/stylesheets/common.css @@ -65,17 +65,14 @@ div.tleft { } /* Page history styling */ -/* automatically generated edit summaries */ +/* the auto-generated edit comments */ .autocomment { color: gray; } -#pagehistory span.hlinedesc { margin-left: 1.4em } -#pagehistory span.hflag { - margin-left: -1em; - font-weight: bold; -} -#pagehistory li { - border: 1px solid White; - padding-left: 1em; +#pagehistory span.user { + margin-left: 1.4em; + margin-right: 0.4em; } +#pagehistory span.minor { font-weight: bold; } +#pagehistory li { border: 1px solid White; } #pagehistory li.selected { background-color:#f9f9f9; border:1px dashed #aaaaaa; diff --git a/stylesheets/common_rtl.css b/stylesheets/common_rtl.css index f3e52aff03..8f50b2abb7 100644 --- a/stylesheets/common_rtl.css +++ b/stylesheets/common_rtl.css @@ -8,3 +8,8 @@ fieldset.operaprefsection { margin-left: 0; margin-right: 18em; } +/* page history */ +#pagehistory span.user { + margin-right: 1.4em; + margin-left: 0.4em; +} diff --git a/stylesheets/monobook/main.css b/stylesheets/monobook/main.css index c2d1bed52c..8facf54b1c 100644 --- a/stylesheets/monobook/main.css +++ b/stylesheets/monobook/main.css @@ -405,15 +405,12 @@ div.townBox dl dd { /* Page history styling */ /* the auto-generated edit comments */ .autocomment { color: gray; } -#pagehistory span.hlinedesc { margin-left: 1.4em } -#pagehistory span.hflag { - margin-left: -1em; - font-weight: bold; -} -#pagehistory li { - border: 1px solid White; - padding-left: 1em; +#pagehistory span.user { + margin-left: 1.4em; + margin-right: 0.4em; } +#pagehistory span.minor { font-weight: bold; } +#pagehistory li { border: 1px solid White; } #pagehistory li.selected { background-color:#f9f9f9; border:1px dashed #aaaaaa; -- 2.20.1 From 7bbd0f1608d305169c7bc0ea2275d39e9c1ef14b Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 21 May 2004 09:27:35 +0000 Subject: [PATCH 07/16] m moved to start of comment --- includes/PageHistory.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/PageHistory.php b/includes/PageHistory.php index f3b24cd1d7..ea7a74f4a9 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -182,11 +182,9 @@ class PageHistory { } $arbitrary .= ''; } - $M = wfMsg( "minoreditletter" ); - if ( $isminor ) { - $s .= "{$M}"; - } - $s .= "({$curlink}) (!OLDID!{$oid}!) $arbitrary {$link} {$ul}"; + $s .= "({$curlink}) (!OLDID!{$oid}!) $arbitrary {$link} {$ul}"; + $s .= $isminor ? ' '.wfMsg( "minoreditletter" ).'': '' ; + if ( "" != $c && "*" != $c ) { -- 2.20.1 From 38ccc820e4356ccc4226c871e68b3a212000332f Mon Sep 17 00:00:00 2001 From: Jerome Jamnicky Date: Fri, 21 May 2004 11:28:17 +0000 Subject: [PATCH 08/16] * Option to not create keys on new links table, and allow duplicates. This gives a huge speed improvement when converting a very large (e.g. 6 million rows) MyISAM links table. * Option to log timing data to a file. * Tweaks to progress reporting. --- maintenance/convertLinks.php | 106 ++++++++++++++++++++++++++--------- 1 file changed, 80 insertions(+), 26 deletions(-) diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index fefa962cdc..8e3bb51799 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -1,7 +1,5 @@ ID) to the new schema (ID->ID) -# This hasn't been thoroughly tested yet. - # The wiki should be put into read-only mode while this script executes require_once( "commandLine.inc" ); @@ -10,14 +8,28 @@ require_once( "../AdminSettings.php" ); $numRows = $tuplesAdded = $numBadLinks = $curRowsRead = 0; #counters etc $totalTuplesInserted = 0; # total tuples INSERTed into links_temp + $reportCurReadProgress = true; #whether or not to give progress reports while reading IDs from cur table $curReadReportInterval = 1000; #number of rows between progress reports + $reportLinksConvProgress = true; #whether or not to give progress reports during conversion -$linksConvInsertInterval = 1000; #number of rows between INSERTs and, optionally, reports +$linksConvInsertInterval = 1000; #number of rows per INSERT + $initialRowOffset = 0; -$finalRowOffset = 0; # not used yet; highest row number from links table to process -$createTemporaryTable = 1; # create a temporary table to hold new links table during conv process -$overwriteLinksTable = 1; # overwrite the old links table with the new one +#$finalRowOffset = 0; # not used yet; highest row number from links table to process + +# Overwrite the old links table with the new one. If this is set to false, +# the new table will be left at links_temp. +$overwriteLinksTable = true; + +# Don't create keys, and so allow duplicates in the new links table. +# This gives a huge speed improvement for very large links tables which are MyISAM. (What about InnoDB?) +$noKeys = false; + + +$logPerformance = false; # output performance data to a file +$perfLogFilename = "convLinksPerf.txt"; +#-------------------------------------------------------------------- $res = wfQuery( "SELECT COUNT(*) AS count FROM links", DB_WRITE ); $row = wfFetchObject($res); @@ -33,9 +45,13 @@ if ( $numRows == 0 ) { print "Schema already converted\n"; exit; } - + + if ( $logPerformance ) { $fh = fopen ( $perfLogFilename, "w" ); } + $baseTime = $startTime = getMicroTime(); # Create a title -> cur_id map - print "Loading IDs from cur table..."; + print "Loading IDs from cur table...\n"; + performanceLog ( "Reading $numRows rows from cur table...\n" ); + performanceLog ( "rows read vs seconds elapsed:\n" ); wfBufferSQLResults( false ); $res = wfQuery( "SELECT cur_namespace,cur_title,cur_id FROM cur", DB_WRITE ); $ids = array(); @@ -49,28 +65,38 @@ if ( $numRows == 0 ) { $curRowsRead++; if ($reportCurReadProgress) { if (($curRowsRead % $curReadReportInterval) == 0) { + performanceLog( $curRowsRead . " " . (getMicroTime() - $baseTime) . "\n" ); print "\t$curRowsRead rows of cur table read.\n"; } } } wfFreeResult( $res ); wfBufferSQLResults( true ); - print "Finished loading IDs.\n"; - if ( $createTemporaryTable ) { - # Create temporary table which will become the new links table. - createTempTable(); - } - + print "Finished loading IDs.\n\n"; + performanceLog( "Took " . (getMicroTime() - $baseTime) . " seconds to load IDs.\n\n" ); +#-------------------------------------------------------------------- + # Now, step through the links table (in chunks of $linksConvInsertInterval rows), # convert, and write to the new table. + createTempTable(); + performanceLog( "Resetting timer.\n\n" ); + $baseTime = getMicroTime(); print "Processing $numRows rows from links table...\n"; + performanceLog( "Processing $numRows rows from links table...\n" ); + performanceLog( "rows inserted vs seconds elapsed:\n" ); + for ($rowOffset = $initialRowOffset; $rowOffset < $numRows; $rowOffset += $linksConvInsertInterval) { $sqlRead = "SELECT * FROM links LIMIT $linksConvInsertInterval OFFSET $rowOffset"; $res = wfQuery($sqlRead, DB_READ); - $sqlWrite = array("INSERT IGNORE INTO links_temp(l_from,l_to) VALUES "); + if ( $noKeys ) { + $sqlWrite = array("INSERT INTO links_temp(l_from,l_to) VALUES "); + } else { + $sqlWrite = array("INSERT IGNORE INTO links_temp(l_from,l_to) VALUES "); + } + $tuplesAdded = 0; # no tuples added to INSERT yet while ( $row = wfFetchObject($res) ) { - $fromTitle = $row->l_from; + $fromTitle = $row->l_from; if ( array_key_exists( $fromTitle, $ids ) ) { # valid title $from = $ids[$fromTitle]; $to = $row->l_to; @@ -86,16 +112,22 @@ if ( $numRows == 0 ) { wfFreeResult($res); #print "rowOffset: $rowOffset\ttuplesAdded: $tuplesAdded\tnumBadLinks: $numBadLinks\n"; if ( $tuplesAdded != 0 ) { - if ($reportLinksConvProgress) + if ($reportLinksConvProgress) { print "Inserting $tuplesAdded tuples into links_temp..."; + } wfQuery( implode("",$sqlWrite) , DB_WRITE ); $totalTuplesInserted += $tuplesAdded; if ($reportLinksConvProgress) print " done. Total $totalTuplesInserted tuples inserted.\n"; + performanceLog( $totalTuplesInserted . " " . (getMicroTime() - $baseTime) . "\n" ); } } - print "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n"; + print "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n\n"; + performanceLog( "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n" ); + performanceLog( "Total execution time: " . (getMicroTime() - $startTime) . " seconds.\n" ); + if ( $logPerformance ) { fclose ( $fh ); } } +#-------------------------------------------------------------------- if ( $overwriteLinksTable ) { $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); @@ -111,17 +143,21 @@ if ( $overwriteLinksTable ) { # Swap in the new table, and move old links table to links_backup print "Swapping tables 'links' to 'links_backup'; 'links_temp' to 'links'..."; $dbConn->query( "RENAME TABLE links TO links_backup, links_temp TO links", DB_WRITE ); - print " done.\n"; + print " done.\n\n"; $dbConn->close(); print "Conversion complete. The old table remains at links_backup;\n"; print "delete at your leisure.\n"; } else { - print "Conversion complete.\n"; + print "Conversion complete. The converted table is at links_temp;\n"; + print "the original links table is unchanged.\n"; } +#-------------------------------------------------------------------- + function createTempTable() { global $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; + global $noKeys; $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); if (!($dbConn->isOpen())) { @@ -134,11 +170,29 @@ function createTempTable() { print " done.\n"; print "Creating temporary links table..."; - $dbConn->query( "CREATE TABLE links_temp ( - l_from int(8) unsigned NOT NULL default '0', - l_to int(8) unsigned NOT NULL default '0', - UNIQUE KEY l_from(l_from,l_to), - KEY (l_to))", DB_WRITE); - print " done.\n"; + if ( $noKeys ) { + $dbConn->query( "CREATE TABLE links_temp ( " . + "l_from int(8) unsigned NOT NULL default '0', " . + "l_to int(8) unsigned NOT NULL default '0')", DB_WRITE); + } else { + $dbConn->query( "CREATE TABLE links_temp ( " . + "l_from int(8) unsigned NOT NULL default '0', " . + "l_to int(8) unsigned NOT NULL default '0', " . + "UNIQUE KEY l_from(l_from,l_to), " . + "KEY (l_to))", DB_WRITE); + } + print " done.\n\n"; +} + +function performanceLog( $text ) { + global $logPerformance, $fh; + if ( $logPerformance ) { + fwrite( $fh, $text ); + } +} + +function getMicroTime() { # return time in seconds, with microsecond accuracy + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); } ?> -- 2.20.1 From 98b8ce7cf5ae904887dd14cc9e45cbc312c772d8 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 21 May 2004 16:03:46 +0000 Subject: [PATCH 09/16] access key and tooltip for 'compare selected versions' button, defaults to 'v' --- includes/PageHistory.php | 3 ++- languages/Language.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/PageHistory.php b/includes/PageHistory.php index ea7a74f4a9..49b42f3f2a 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -123,7 +123,8 @@ class PageHistory { $s = $skip ? "" : preg_replace( "/!OLDID![0-9]+!/", $last, $this->lastline ); $s .= "\n"; if( $this->linesonpage > 1) { - $s .= '

\n"; + $s .= '

\n"; } $s .= "\n"; return $s; diff --git a/languages/Language.php b/languages/Language.php index 4a9e5fcbb0..82adf4431c 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1488,6 +1488,7 @@ amusement.", 'accesskey-preview' => 'p', 'accesskey-contributions' => '', 'accesskey-emailuser' => '', +'accesskey-compareselectedversions' => 'v', # tooltip help for the main actions 'tooltip-atom' => 'Atom feed for this page', @@ -1532,6 +1533,7 @@ amusement.", 'tooltip-contributions' => 'View the list of contributions of this user', 'tooltip-emailuser' => 'Send a mail to this user', 'tooltip-rss' => 'RSS feed for this page', +'tooltip-compareselectedversions' => 'See the differences between the two selected versions of this page. [alt-v]', # Metadata "nodublincore" => "Dublin Core RDF metadata disabled for this server.", -- 2.20.1 From 8cb66554e72e167491ca4a04998294c65c7f1823 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 21 May 2004 18:56:56 +0000 Subject: [PATCH 10/16] Fix for querypage changes --- includes/SpecialDeadendpages.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/SpecialDeadendpages.php b/includes/SpecialDeadendpages.php index 0c392804b7..84641a5d51 100644 --- a/includes/SpecialDeadendpages.php +++ b/includes/SpecialDeadendpages.php @@ -15,13 +15,11 @@ class DeadendPagesPage extends PageQueryPage { } function getSQL( $offset, $limit ) { - return "SELECT cur_title " . + return "SELECT cur_title as title, 0 as value " . "FROM cur LEFT JOIN links ON cur_id = l_from " . "WHERE l_from IS NULL " . "AND cur_namespace = 0 " . - "AND cur_is_redirect = 0 " . - "ORDER BY cur_title " . - "LIMIT {$offset}, {$limit}"; + "AND cur_is_redirect = 0"; } } -- 2.20.1 From 59b9297a7ef3a907905f4a5dc5915bfca2264fa9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 21 May 2004 18:58:09 +0000 Subject: [PATCH 11/16] Temporary block on Special:Import for the beta cycle --- includes/SpecialImport.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/SpecialImport.php b/includes/SpecialImport.php index a7384250a8..52de966b3c 100644 --- a/includes/SpecialImport.php +++ b/includes/SpecialImport.php @@ -21,6 +21,11 @@ function wfSpecialImport( $page = "" ) { global $wgOut, $wgLang, $wgRequest, $wgTitle; global $wgImportSources; + ### + $wgOut->addWikiText( "Special:Import is not ready for this beta release, sorry." ); + return; + ### + if( $wgRequest->wasPosted() && $wgRequest->getVal( 'action' ) == 'submit') { $importer = new WikiImporter(); -- 2.20.1 From d5c8171a3157337557bc54ecb730d7dd35778ca3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 21 May 2004 19:04:52 +0000 Subject: [PATCH 12/16] Update version and docs to 1.3.0beta1 --- INSTALL | 219 ++--------------------------------- RELEASE-NOTES | 4 +- includes/DefaultSettings.php | 2 +- 3 files changed, 12 insertions(+), 213 deletions(-) diff --git a/INSTALL b/INSTALL index c3c93fe067..f23e85d120 100644 --- a/INSTALL +++ b/INSTALL @@ -6,6 +6,9 @@ Starting with MediaWiki 1.2.0, it's possible to install and configure the wiki "in-place", as long as you have the necessary prerequesites available. +In 1.3.0 the old command-line installer has been removed. +A new command-line installer/upgrader may come soon... + Required software: * Web server with PHP 4.1.2 or higher (4.3.x is preferred) * A MySQL server. 4.0.x is preferred, but 3.2.x should @@ -67,223 +70,17 @@ directory, or at least make it not world-writable (though it will refuse to config again if the wiki is set up). ----- -"Classic" install instructions: ----- - -THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE. -THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN -OVER YOUR DOG. - -If you use the command-line install, you MUST NOT make the -source directory web-accessible, as it will expose maintenance -scripts to the public internet. You MUST NOT install to the -same directory as your are installing from, this WILL -overwrite and destroy files. - -Because install.php and update.php are unsafe, they have -been disabled as of 1.2.4. If you wish to use them, remove -the "die()" call at the top of the file. - --- - -The Wikipedia software was developed collaboratively by -many people, so it's something of a hodgepodge. The -main wiki software itself is written in PHP, and requires -the Apache web server and MySQL database. The optional -math rendering functions are written in Objective CAML, -which is required to compile them. - -Recommended versions are: Apache 1.3.27 or later; MySQL -4.0.13 or later; PHP 4.3.2 or later. The installation at -wikipedia.org also uses PHP Accelerator software, but -that's entirely optional and doesn't affect anything else. - -The math rendering functions are more complex, and will -probably only work on Linux. Objective CAML (probably -3.06 or later) is required to compile texvc, but produces -static binaries. TeTeX and ImageMagick are required at -runtime, and ImageMagick requires GhostScript. These are -present in most Linux distributions. - ----- -Scripts install.php and update.php ----- - -Before installing the software, you must copy the file -"LocalSettings.sample" to "LocalSettings.php", and -"AdminSettings.sample" to "AdminSettings.php", and -customize both of the php files to your local setup -(things like installation path, passwords, etc.) The -script install.php can then be run to install the -software. It must be run from the command line with -PHP: that is, type "php install.php" (you may need to -specify the path the php executable). You will probably -need to run as root. - - Hint: If you are using Debian, the PHP interpreter is - not part of the "php4" package; you need to install - php4-cgi separately (the interpreter will be called - php4). - -This script will copy all the necessary software over to -the directories you have specified in the settings files. -It will then warn you that it is about to create the -database and give you the chance to exit. If you are -installing the software to an existing database, you can -answer "no" here and it will be left alone. The software -installation will be otherwise complete. If you do choose -to create a new database, you will need te root password -to your MySQL installation. - -If you are merely updating an existing installation, run -"php update.php" instead of install. This will copy all -the software, and also run any database updates that may -be necessary. These should give appropriate warnings if -there are any dangerous ones. - ----- -Building from scratch ----- - -Here are some more notes on building a system from scratch -the way it was done for the Wikipedia server: - -Downloads: - - gcc-2.95.3.tar.gz (only if you now have gcc 2.96) - mysql-4.0.13.tar.gz (or 3.23.57 should work) - libiconv-1.8.tar.gz - apache_1.3.27.tar.gz - php-4.3.2.tar.gz - apc-cvs.tar.gz - -And for math support: - ocaml-3.06.tar.gz (3.04 doesn't work) - (TeTeX, ImageMagick, and GhostScript come with most Linux distros) - -1. MySQL strongly recommends using gcc 2.95 to compile MySQL. - RedHat Linux 7.x comes with 2.96 by default, so you'll have to install - 2.95 first. Use "../gcc*/configure --enable-shared" If your Linux - installation doesn't use gcc 2.96, or has a more recent gcc 3.x, - you can skip this step. - -2. Install MySQL source; add "mysql" user and group. Make sure the - directory into which you installed gcc 2.95 appears before the - directory of gcc 2.96 in your path. Configure with: - - FLAGS="-O3 -mcpu=i686" CXX=gcc CXXFLAGS="-O3 -mcpu=i686 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex - - Edit the file myisam/ftdefs.h, changing the define for minimum word - length for fulltext indexing: #define MIN_WORD_LEN 2. Update - $wgDBminWordLen in LocalSettings.php to reflect this. Build and - install according to instructions. Make root user as recommended; - the root password will be required for the wiki installation script. - -3. Unpack the phase3.zip source distribution, or check out the "phase3" - module from CVS. Copy LocalSettings.sample to LocalSettings.php, - AdminSettings.sample to AdminSettings.php, and customize them for - things like local paths and passwords. If desired, update - FulltextStoplist.php from the MySQL sources if you have customized - MySQL's stop list. - - If you are running anything other than Wikipedia itself you'll want - to make a lot of changes to the LanguageXX.php files so it talks about - _your_ site and _your_ license. :) - -4. Optionally, install libiconv (http://www.gnu.org/software/libiconv/). - This will be used by some language packages for converting - native-charset URLs to and from UTF-8. If you're running an - English-only wiki, this probably won't be necessary. (Most Linux - distributions should come with libiconv anyway, but check for - a separate 'dev' package if on RedHat.) - -5. Unpack Apache distribution and begin configuring, but don't finish - build yet. Configure with something like: - - OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache - -6. If you'll want to use Apache's mod_rewrite to make page-viewing URLs - look like static links (as wikipedia.org does), install the included - patch "apache-ampersand.diff" which is needed to support page titles - with ampersands in them: - - patch -p0 < /path/to/maintenance/apache-ampersand.diff - -7. Unpack and configure PHP. Configure with something like: - - ./configure --enable-shmop --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/local/mysql --with-iconv --with-apache=/home/lee/src/apache_1.3.26 --with-readline --enable-sockets - -Or for Apache 2.0 module: - ./configure --enable-shmop --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/local/mysql --with-iconv --with-apxs2filter=/usr/local/apache/bin/apxs --with-readline --enable-sockets - - (using your own local paths, of course). Build and install as - instructed. - -8. Finish building Apache. Configure with something like: - - OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache --enable-module=rewrite --enable-module=mmap-static --enable-module=headers --enable-module=expires --activate-module=src/modules/php4/libphp4.a - - Update httpd.conf as needed for your site. For example: - - - AddType application/x-httpd-php .php .php4 - AddType application/x-httpd-php-source .phps - - - php_admin_flag engine off - - - - php_admin_flag engine on - - - RewriteEngine On - RewriteMap ampescape int:ampescape - RewriteRule ^/wiki/(.*)$ /index.php?title=${ampescape:$1} [L] - - It is *seriously* recommended that you configure the webserver - to disable running of PHP scripts except in the script directories - (the "php_admin_flag engine off/on" directives above) to prevent - the uploading and running of malicious scripts. - -9. Optionally, install APC or another PHP cache plug-in, following - standard instructions for installing as a Zend extension. - -10. If using embedded TeX support, be sure TeX and ImageMagick are - installed (they are common on most Linux distros and freely - downloadable). Also get and install OCaml according to its - instructions. - - You'll need to compile the texvc helper script; enter the math - subdirectory of the source tree and run "make". - - If you want embedded TeX support, enable it by setting - - $wgUseTex = true; - - in LocalSettings.php - -11. You should now be able to run the install.php script. Use PHP in - command-line mode, i.e., type "php install.php". Should be run as - root, or as a user or group able to create files and directories - in the installation tree. - -12. If you have Java installed and running, install the "ant" package - from Apache (http://ant.apache.org/) and run ant in the testsuite - directory to build the tests. Copy wikitest.prefs.sample to - wikitest.prefs, and edit to reflect your local settings. Then - "./run WikiSuite -o -b" will run the whole test suite and report. - ---- -Don't forget that this is pre-release software under development! +Don't forget that this is free software under development! Chances are good there's a crucial step that hasn't made it into the documentation. You should probably sign up for the -Wikipedia developers' mailing list; you can ask for help (please +MediaWiki developers' mailing list; you can ask for help (please provide enough information to work with, and preferably be aware of what you're doing!) and keep track of major changes to the software, including performance improvements and security patches. -http://mail.wikipedia.org/mailman/listinfo/wikitech-l +http://mail.wikipedia.org/mailman/listinfo/mediawiki-l (site admin support) + +http://mail.wikipedia.org/mailman/listinfo/wikitech-l (development) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4eafc10c72..8ad826ba9d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -1,6 +1,8 @@ = MediaWiki release notes = -== Version 1.3.0pre-alpha == +== Version 1.3.0beta1, 2004-05-21 == + +**** THIS IS A BETA AND MAY STUNT YOUR GROWTH OR KILL YOUR PETS **** Look & layout: * New default layout 'MonoBook' diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index e4ea684723..52eb0b1ef1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6,7 +6,7 @@ # like $wgScriptPath, you must also localize everything that # depends on it. -$wgVersion = "1.3.0pre-alpha"; +$wgVersion = "1.3.0beta1"; $wgSitename = "MediaWiki"; # Please customize! $wgMetaNamespace = FALSE; # will be same as you set $wgSitename -- 2.20.1 From dc6b999e35ab1672f5e260e5329396f481a64d64 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Fri, 21 May 2004 22:05:27 +0000 Subject: [PATCH 13/16] updates from echoray --- languages/LanguageDe.php | 75 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/languages/LanguageDe.php b/languages/LanguageDe.php index 1562a4efe8..90648b781d 100644 --- a/languages/LanguageDe.php +++ b/languages/LanguageDe.php @@ -151,7 +151,7 @@ if($wgMetaNamespace === FALSE) "mainpage" => "Hauptseite", "mainpagetext" => "Die Wiki Software wurde erfolgreich installiert.", "mainpagedocfooter" => "Siehe die [http://meta.wikipedia.org/wiki/MediaWiki_i18n Dokumentation zur Anpassung der Benutzeroberfläche] -und das [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide Benutzrhandbuch] für Hilfe zur Benutzung und Konfiguration.", +und das [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide Benutzerhandbuch] für Hilfe zur Benutzung und Konfiguration.", "portal" => "Wikipedia-Portal", "portal-url" => "{{ns:4}}:Portal", "about" => "Über", @@ -218,6 +218,8 @@ und das [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide Benutzrhandbuch "lastmodified" => "Diese Seite wurde zuletzt geändert um $1.", "viewcount" => "Diese Seite wurde bisher $1 mal abgerufen.", "copyright" => "Inhalt ist verfügbar unter der $1.", +"poweredby" => "{{SITENAME}} benutzt [http://www.mediawiki.org/ MediaWiki], eine Open Source Wiki-Engine.", +"printsubtitle" => "(Von {{SERVER}})", "gnunote" => "Diese Seite ist unter der GNU FDL verfügbar.", "protectedpage" => "Geschützte Seite", "administrators" => "{$wgMetaNamespace}:Administratoren", @@ -225,11 +227,15 @@ und das [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide Benutzrhandbuch "sysoptext" => "Dieser Vorgang kann aus Sicherheitsgründen nur von Benutzern mit \"Sysop\"-Status durchgeführt werden. Siehe auch $1.", "developertitle" => "Entwickler-Zugang notwendig", "developertext" => "Dieser Vorgang kann aus Sicherheitsgründen nur von Benutzern mit \"Entwickler\"-Status durchgeführt werden. Siehe auch $1.", +"bureaucrattitle" => "Bürokraten-Rechte notwendig", +"bureaucrattext" => "Dieser Vorgang kann nur von Benutzern mit \"Bürokrat\"-Status durchgeführt werden.", "nbytes" => "$1 Byte", "go" => "Los", "ok" => "OK", "sitetitle" => "{$wgSitename}", "sitesubtitle" => "Die freie Enzyklopädie", +"pagetitle" => "$1 - {{SITENAME}}", +"sitesubtitle" => "Die freie Wissensdatenbank", "retrievedfrom" => "Von \"$1\"", "newmessages" => "Sie haben $1.", "newmessageslink" => "neue Nachrichten", @@ -239,6 +245,16 @@ und das [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide Benutzrhandbuch "hidetoc" => "Verbergen", "thisisdeleted" => "Ansehen oder wiederherstellen von $1?", "restorelink" => "$1 gelöschte Bearbeitungsvorgänge", +"feedlinks" => "Feed:", + +# Kurzworte für jeden Namespace, u.a. von MonoBook verwendet +'nstab-main' => 'Artikel', +'nstab-user' => 'Benutzerseite', +'nstab-media' => 'Media', +'nstab-special' => 'Spezial', +'nstab-image' => 'Bild', +'nstab-help' => 'Hilfe', +'nstab-category' => 'Kategorie', # Editier-Werkzeugleiste "bold_sample"=>"Fetter Text", @@ -303,6 +319,16 @@ gesperrt werden soll und eine Absch "badtitletext" => "Der Titel der angeforderten Seite war ungültig, leer, oder ein ungültiger Sprachlink von einem anderen Wiki.", "perfdisabled" => "Diese Funktion wurde wegen Überlastung des Servers vorübergehend deaktiviert. Versuchen Sie es bitte zwischen 02:00 und 14:00 UTC noch einmal
(Aktuelle Serverzeit : ".date("H:i:s")." UTC).", "perfdisabledsub" => "Hier ist eine gespeicherte Kopie von $1:", +"perfcached" => "Die folgenden Daten stammen aus dem Cache und sind möglicherweise nicht aktuell:", +"wrong_wfQuery_params" => "Falsche Parameter für wfQuery()
+Funktion: $1
+Query: $2 +", +"viewsource" => "Quelltext betrachten", +"protectedtext" => "Diese Seite ist für das Bearbeiten gesperrt, dafür kann es diverse Gründe geben, siehe [[{[ns:4}}:Geschützte Seiten]]. + +Sie können den Quelltext dieser Seite betrachten und kopieren:", +'seriousxhtmlerrors' => 'Tidy entdeckte schwere Fehler im XHTML-Markup.', # Login and logout pages @@ -324,6 +350,7 @@ Vergessen Sie nicht, Ihre Einstellungen anzupassen.", "alreadyloggedin" => "Benutzer $1, Sie sind bereits angemeldet!
\n", "login" => "Anmelden", +"loginprompt" => "Um sich bei {{SITENAME}} anmelden zu können, müssen Cookies aktiviert sein.", "userlogin" => "Anmelden", "logout" => "Abmelden", "userlogout" => "Abmelden", @@ -334,6 +361,7 @@ Vergessen Sie nicht, Ihre Einstellungen anzupassen.", "userexists" => "Dieser Benutzername ist schon vergeben. Bitte wählen Sie einen anderen.", "youremail" => "Ihre E-Mail", "yournick" => "Ihr \"Spitzname\" (zum \"Unterschreiben\")", +"yourrealname" => "Ihr echter Name (keine Pflicht)", "emailforlost" => "Falls Sie Ihr Passwort vergessen haben, kann Ihnen ein neues an Ihre E-Mail-Adresse gesendet werden.", "loginerror" => "Fehler bei der Anmeldung", "noname" => "Sie müssen einen Benutzernamen angeben.", @@ -351,6 +379,8 @@ Sie sollten sich jetzt anmelden und Ihr Passwort "noemail" => "Benutzer \"$1\" hat keine E-Mail-Adresse angegeben.", "passwordsent" => "Ein neues Passwort wurde an die E-Mail-Adresse von Benutzer \"$1\" gesendet. Bitte melden Sie sich an, sobald Sie es erhalten.", +"loginend" => " ", +"mailerror" => "Fehler beim Senden von Mail: $1", # Edit pages # @@ -371,6 +401,8 @@ Als Grund wurde angegeben:
$2

Bitte kontaktieren Sie den Administrator, um "whitelistreadtext" => "Sie müssen sich [[Spezial:Userlogin|hier anmelden]] um Artikel lesen zu können.", "whitelistacctitle" => "Sie sind nicht berechtigt einen Account zu erzeugen", "whitelistacctext" => "Um in diesem Wiki Accounts anlegen zu dürfen müssen Sie sich [[Spezial:Userlogin|hier anmelden]] und die nötigen Berechtigungen haben.", +"loginreqtitle" => "Anmeldung erforderlich", +"loginreqtext" => "Sie müssen sich [[Spezial:Userlogin|anmelden]], um andere Seiten betrachten zu können.", "accmailtitle" => "Passwort wurde verschickt.", "accmailtext" => "Das Passwort von $1 wurde an $2 geschickt.", "newarticle" => "(Neu)", @@ -378,6 +410,12 @@ Als Grund wurde angegeben:
$2

Bitte kontaktieren Sie den Administrator, um "anontalkpagetext" => "---- ''Dies ist die Diskussions-Seite eines nicht angemeldeten Benutzers. Wir müssen hier die numerische [[IP-Adresse]] zur Identifizierung verwenden. Eine solche Adresse kann nacheinander von mehreren Benutzern verwendet werden. Wenn Sie ein anonymer Benutzer sind und denken, dass irrelevante Kommentare an Sie gerichtet wurden, [[Spezial:Userlogin|melden Sie sich bitte an]], um zukünftige Verwirrung zu vermeiden. ''", "noarticletext" => "(Dieser Artikel enthält momentan keinen Text)", +'usercssjs' => "'''Beachten Sie:''' Nach dem Speichern müssen Sie ihrem Browser sagen, die neue Version zu laden: '''Mozilla:''' Klick auf ''Neu laden''(oder ''Strg-R''), '''IE / Opera:''' ''Strg-F5'', '''Safari:''' ''Cmd-r'', '''Konqueror''' ''Strg-R''.", +'usercsspreview' => "== Vorschau ihres Benutzer-CSS. == +'''Beachten Sie:''' Nach dem Speichern müssen Sie ihrem Browser sagen, die neue Version zu laden: '''Mozilla:''' Klick auf ''Neu laden''(oder ''Strg-R''), '''IE / Opera:''' ''Strg-F5'', '''Safari:''' ''Cmd-r'', '''Konqueror''' ''Strg-R''.", +'userjspreview' => "== Vorschau Ihres Benutzer-Javascript. == +'''Beachten Sie:''' Nach dem Speichern müssen Sie ihrem Browser sagen, die neue Version zu laden: '''Mozilla:''' Klick auf ''Neu laden''(oder ''Strg-R''), '''IE / Opera:''' ''Strg-F5'', '''Safari:''' ''Cmd-r'', '''Konqueror''' ''Strg-R''.", +'usercssjsyoucanpreview' => "Tipp: Benutzen Sie den Vorschau-Button, um Ihr neues css/js vor dem Speichern zu testen.", "updated" => "(Geändert)", "note" => "Hinweis: ", "previewnote" => "Dies ist nur eine Vorschau, der Artikel wurde noch nicht gespeichert!", @@ -423,7 +461,9 @@ Benutzer mit Sysop-Rechten bearbeitet werden kann. Beachten Sie bitte die "next" => "Nächste", "last" => "Letzte", "orig" => "Original", -"histlegend" => "Legende: +"histlegend" => "Diff Auswahl: Die Boxen der gewünschten +Versionen markieren und 'Enter' drücken oder den Button unten klicken/alt-v.
+Legende: (Aktuell) = Unterschied zur aktuellen Version, (Letzte) = Unterschied zur vorherigen Version, M = Kleine Änderung", @@ -434,6 +474,9 @@ M = Kleine "loadingrev" => "lage Versionen zur Unterscheidung", "lineno" => "Zeile $1:", "editcurrent" => "Die aktuelle Version dieses Artikels bearbeiten", +'selectnewerversionfordiff' => 'Eine neuere Version zum Vergleich auswählen', +'selectolderversionfordiff' => 'Eine ältere Version zum Vergleich auswählen', +'compareselectedversions' => 'Gewählte Versionen vergleichen', # Search results # @@ -719,6 +762,8 @@ und eine g "emailuser" => "E-Mail an diesen Benutzer", "emailpage" => "E-Mail an Benutzer", "emailpagetext" => "Wenn dieser Benutzer eine gültige E-Mail-Adresse angegeben hat, können Sie ihm mit dem untenstehenden Formular eine E-Mail senden. Als Absender wird die E-Mail-Adresse aus Ihren Einstellungen eingetragen, damit der Benutzer Ihnen antworten kann.", +"usermailererror" => "Das Mail-Objekt gab einen Fehler zurück: ", +"defemailsubject" => "{{SITENAME}} e-mail", "noemailtitle" => "Keine E-Mail-Adresse", "noemailtext" => "Dieser Benutzer hat keine gültige E-Mail-Adresse angegeben, oder möchte keine E-Mail von anderen Benutzern empfangen.", "emailfrom" => "Von", @@ -767,6 +812,7 @@ $3... komplette Liste zeigen und bearbeiten.)", "iteminvalidname" => "Ploblem mit dem Eintrag '$1', ungültiger Name...", "wlnote" => "Es folgen die letzten $1 Änderungen der letzten $2 Stunden.", "wlshowlast" => "Zeige die letzen $1 Stunden $2 Tage $3", +"wlsaved" => "Dies ist eine gespeicherte Version Ihrer Beobachtungsliste.", # Delete/protect/revert # @@ -795,7 +841,8 @@ Im $2 finden Sie eine Liste der letzten L "reverted" => "Auf eine alte Version zurückgesetzt", "deletecomment" => "Grund der Löschung", "imagereverted" => "Auf eine alte Version zurückgesetzt.", -"rollback" => "Zurücknahme der Aenderungen", +"rollback" => "Zurücknahme der Änderungen", +'rollback_short' => 'Rollback', "rollbacklink" => "Rollback", "rollbackfailed" => "Zurücknahme gescheitert", "cantrollback" => "Die Änderung kann nicht zurückgenommen werden; der @@ -934,6 +981,10 @@ Diskussions-Seite nicht, da schon eine mit dem neuen Titel existiert. Bitte glei "exporttext" => "Sie können den Text und die Bearbeitungshistorie einer bestimmten oder einer Auswahl von Seiten nach XML exportieren. Das Ergebnis kann in ein anderes Wiki mit WikiMedia Software eingespielt werden, bearbeitet oder archiviert werden.", "exportcuronly" => "Nur die aktuelle Version der Seite exportieren", "missingimage" => "Fehlendes Bild
$1\n", + +#Tooltips: +'tooltip-atom' => 'Atom-Feed von dieser Seite', +'tooltip-addsection' => 'Einen Kommentar zu dieser Seite hinzufügen. [alt-+]', 'tooltip-article' => 'Artikel betrachten [alt-a]', 'tooltip-talk' => 'Diesen Artikel diskutieren [alt-t]', 'tooltip-edit' => 'Sie können diesen Artikel bearbeiten. Benutzen Sie die Vorschau, bevor Sie die Seite speichern. [alt-e]', @@ -974,7 +1025,11 @@ Diskussions-Seite nicht, da schon eine mit dem neuen Titel existiert. Bitte glei 'tooltip-contributions' => 'Liste der beiträge dieses Benutzers.', 'tooltip-emailuser' => 'Senden Sie eine Mail an diesen Benutzer', 'tooltip-rss' => 'RSS-Feed von dieser Seite.', +'tooltip-compareselectedversions' => 'Unterschiede zwischen zwei ausgewählten Versionen dieser Seite vergleichen. [alt-v]', + +#Tastatur-Shortcuts 'accesskey-article' => 'a', +'accesskey-addsection' => '+', 'accesskey-talk' => 't', 'accesskey-edit' => 'e', 'accesskey-viewsource' => 'e', @@ -1012,6 +1067,8 @@ Diskussions-Seite nicht, da schon eine mit dem neuen Titel existiert. Bitte glei 'accesskey-preview' => 'p', 'accesskey-contributions' => '', 'accesskey-emailuser' => '', +'accesskey-compareselectedversions' => 'v', + "makesysoptitle" => "Mache einen Benutzer zum Administrator", "makesysoptext" => "Diese Maske wird von Bürokraten benutzt, um normale Benutzer zu Administratoren zu machen.", "makesysopname" => "Name des Benutzers:", @@ -1019,6 +1076,11 @@ Diskussions-Seite nicht, da schon eine mit dem neuen Titel existiert. Bitte glei "makesysopok" => "Benutzer \"$1\" ist nun ein Administrator.", "makesysopfail" => "Benutzer \"$1\" konnte nicht zu einem Administrator gemacht werden. (Haben Sie den Namen richtig geschrieben?)", "makesysop" => "Mache einen Benutzer zum Administrator", +"bureaucratlogentry" => "Rechte für Benutzer \"$1\" auf \"$2\" gesetzt", +"rights" => "Rechte:", +"set_user_rights" => "Benutzerrechte setzen", +"user_rights_set" => "Benutzerrechte für \"$1\" aktualisiert", +"set_rights_fail" => "Benutzerrechte für \"$1\" konnten nicht gesetzt werden. (Haben Sie den Namen korrekt eingegeben?)", "1movedto2" => "$1 wurde nach $2 verschoben", "allmessages" => "Alle MediaWiki-Meldungen", "allmessagestext" => "Dies ist eine Liste aller möglichen Meldungen im MediaWiki-Namensraum.", @@ -1033,6 +1095,10 @@ Diskussions-Seite nicht, da schon eine mit dem neuen Titel existiert. Bitte glei "version" => "Version", "protectlogpage" => "Seitenschutz-Logbuch", "protectlogtext" => "Dies ist eine Liste der blockierten Seiten. Siehe [[Wikipedia:Geschützte Seiten]] für mehr Informationen.", +"protectedarticle" => "Artikel [[$1]] geschützt", +"unprotectedarticle" => "Artikel [[$1]] freigegeben", +"protectsub" =>"(Sperren von \"$1\")", +"confirmprotecttext" => "Soll diese Seite wirklich geschützt werden?", "ipbexpiry" => "Ablaufzeit", "blocklogpage" => "Benutzerblockaden-Logbuch", "blocklogentry" => "blockiert [[Benutzer:$1]] - ([[Spezial:Contributions/$1|Beiträge]]) für einen Zeitraum von: $2", @@ -1055,6 +1121,9 @@ Diskussions-Seite nicht, da schon eine mit dem neuen Titel existiert. Bitte glei "math_bad_tmpdir" => "Kann das Temporärverzeichnis für mathematische Formeln nicht anlegen oder beschreiben.", "math_bad_output" => "Kann das Zielverzeichnis für mathematische Formeln nicht anlegen oder beschreiben.", "math_notexvc" => "Das texvc-Programm kann nicht gefunden werden. Bitte beachten Sie math/README.", +'prefs-personal' => 'Benutzerdaten', +'prefs-rc' => 'Letzte Änderungen und Anzeige kurzer Artikel', +'prefs-misc' => 'Verschiedene Einstellungen', "import" => "Seiten importieren", "importtext" => "Bitte exportieren Sie die Seite vom Quellwiki mittels Spezial:Export und laden Sie die Datei dann über diese Seite wieder hoch.", "importfailed" => "Import fehlgeschlagen: $1", -- 2.20.1 From aad104e3606aabd61e2eb4bf757c292144c9aac6 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 22 May 2004 02:47:30 +0000 Subject: [PATCH 14/16] various changes aimed at making a bare-bones 1.3 command line installer, for wikimedia --- maintenance/archives/moveCustomMessages.inc | 127 +++++++++++++ maintenance/archives/moveCustomMessages.php | 122 +----------- maintenance/convertLinks.inc | 198 ++++++++++++++++++++ maintenance/convertLinks.php | 190 +------------------ maintenance/trivialCmdLine.php | 11 ++ maintenance/update2.php | 39 ++++ 6 files changed, 379 insertions(+), 308 deletions(-) create mode 100644 maintenance/archives/moveCustomMessages.inc create mode 100644 maintenance/convertLinks.inc create mode 100644 maintenance/trivialCmdLine.php create mode 100644 maintenance/update2.php diff --git a/maintenance/archives/moveCustomMessages.inc b/maintenance/archives/moveCustomMessages.inc new file mode 100644 index 0000000000..8ad118d6c7 --- /dev/null +++ b/maintenance/archives/moveCustomMessages.inc @@ -0,0 +1,127 @@ +setLoaded( true ); # Don't load from DB + $wgUser->setName( "Template namespace initialisation script" ); + $wgUser->addRight( "bot" ); + + # Compose DB key array + $dbkeys = array(); + + foreach ( $wgAllMessagesEn as $key => $enValue ) { + $title = Title::newFromText( $key ); + $dbkeys[$title->getDBkey()] = 1; + } + + $sql = "SELECT cur_id, cur_title FROM cur WHERE cur_namespace= " . NS_MEDIAWIKI; + $res = wfQuery( $sql, DB_READ ); + + # Compile target array + $targets = array(); + while ( $row = wfFetchObject( $res ) ) { + if ( !array_key_exists( $row->cur_title, $dbkeys ) ) { + $targets[$row->cur_title] = 1; + } + } + wfFreeResult( $res ); + + # Create redirects from destination to source + if ( $phase == 0 || $phase == 1 ) { + foreach ( $targets as $partial => $dummy ) { + print "$partial..."; + $nt = Title::makeTitle( NS_TEMPLATE, $partial ); + $ot = Title::makeTitle( NS_MEDIAWIKI, $partial ); + + if ( $nt->createRedirect( $ot, "" ) ) { + print "redirected\n"; + } else { + print "not redirected\n"; + } + } + if ( $phase == 0 ) { + print "\nRedirects created. Update live script files now.\nPress ENTER to continue.\n\n"; + readconsole(); + } + } + + # Move pages + if ( $phase == 0 || $phase == 2 ) { + print "\n"; + foreach ( $targets as $partial => $dummy ) { + $ot = Title::makeTitle( NS_MEDIAWIKI, $partial ); + $nt = Title::makeTitle( NS_TEMPLATE, $partial ); + print "$partial..."; + + if ( $ot->moveNoAuth( $nt ) === true ) { + print "moved\n"; + } else { + print "not moved\n"; + } + # Do deferred updates + while ( count( $wgDeferredUpdateList ) ) { + $up = array_pop( $wgDeferredUpdateList ); + $up->doUpdate(); + } + } + } + + # Convert text + if ( $phase == 0 || $phase == 3 ) { + print "\n"; + + $parser = new Parser; + $options = ParserOptions::newFromUser( $wgUser ); + $completedTitles = array(); + $titleChars = Title::legalChars(); + $mediaWiki = $wgLang->getNsText( NS_MEDIAWIKI ); + $template = $wgLang->getNsText( NS_TEMPLATE ); + $linkRegex = "/\[\[$mediaWiki:([$titleChars]*?)\]\]/"; + $msgRegex = "/{{msg:([$titleChars]*?)}}/"; + + foreach ( $targets as $partial => $dummy ) { + $dest = Title::makeTitle( NS_TEMPLATE, $partial ); + $linksTo = $dest->getLinksTo(); + foreach( $linksTo as $source ) { + $pdbk = $source->getPrefixedDBkey(); + print "$pdbk..."; + if ( !array_key_exists( $pdbk, $completedTitles ) ) { + $completedTitles[$pdbk] = 1; + $id = $source->getArticleID(); + $row = wfGetArray( 'cur', array( 'cur_text' ), + array( 'cur_id' => $source->getArticleID() ) ); + $parser->startExternalParse( $source, $options, OT_WIKI ); + $text = $parser->strip( $row->cur_text, $stripState, false ); + # {{msg}} -> {{}} + $text = preg_replace( $msgRegex, "{{\$1}}", $text ); + # [[MediaWiki:]] -> [[Template:]] + $text = preg_replace_callback( $linkRegex, "wfReplaceMediaWiki", $text ); + $text = $parser->unstrip( $text, $stripState ); + if ( $text != $row->cur_text ) { + wfUpdateArray( 'cur', array( 'cur_text' => $text ), array( 'cur_id' => $id ) ); + print "modified\n"; + } else { + print "not modified\n"; + } + } + } + } + } +} + + +#-------------------------------------------------------------------------------------------------------------- +function wfReplaceMediaWiki( $m ) { + global $targets, $template, $replaceCount; + $title = Title::newFromText( $m[1] ); + $partial = $title->getDBkey(); + + if ( array_key_exists( $partial, $targets ) ) { + $text = "[[$template:{$m[1]}]]"; + } else { + $text = $m[0]; + } + return $text; +} + diff --git a/maintenance/archives/moveCustomMessages.php b/maintenance/archives/moveCustomMessages.php index bcd4974350..bfb761369a 100644 --- a/maintenance/archives/moveCustomMessages.php +++ b/maintenance/archives/moveCustomMessages.php @@ -9,131 +9,13 @@ chdir( ".." ); require_once( "commandLine.inc" ); +require_once( "moveCustomMessages.inc" ); $phase = 0; if ( is_numeric( @$argv[2] ) && $argv[2] > 0) { $phase = intval($argv[2]); } -$wgUser = new User; -$wgUser->setLoaded( true ); # Don't load from DB -$wgUser->setName( "Template namespace initialisation script" ); -$wgUser->addRight( "bot" ); +moveCustomMessages( $phase ); -# Compose DB key array -global $wgAllMessagesEn; -$dbkeys = array(); - -foreach ( $wgAllMessagesEn as $key => $enValue ) { - $title = Title::newFromText( $key ); - $dbkeys[$title->getDBkey()] = 1; -} - -$sql = "SELECT cur_id, cur_title FROM cur WHERE cur_namespace= " . NS_MEDIAWIKI; -$res = wfQuery( $sql, DB_READ ); - -# Compile target array -$targets = array(); -while ( $row = wfFetchObject( $res ) ) { - if ( !array_key_exists( $row->cur_title, $dbkeys ) ) { - $targets[$row->cur_title] = 1; - } -} -wfFreeResult( $res ); - -# Create redirects from destination to source -if ( $phase == 0 || $phase == 1 ) { - foreach ( $targets as $partial => $dummy ) { - print "$partial..."; - $nt = Title::makeTitle( NS_TEMPLATE, $partial ); - $ot = Title::makeTitle( NS_MEDIAWIKI, $partial ); - - if ( $nt->createRedirect( $ot, "" ) ) { - print "redirected\n"; - } else { - print "not redirected\n"; - } - } - if ( $phase == 0 ) { - print "\nRedirects created. Update live script files now.\nPress ENTER to continue.\n\n"; - readconsole(); - } -} - -# Move pages -if ( $phase == 0 || $phase == 2 ) { - print "\n"; - foreach ( $targets as $partial => $dummy ) { - $ot = Title::makeTitle( NS_MEDIAWIKI, $partial ); - $nt = Title::makeTitle( NS_TEMPLATE, $partial ); - print "$partial..."; - - if ( $ot->moveNoAuth( $nt ) === true ) { - print "moved\n"; - } else { - print "not moved\n"; - } - # Do deferred updates - while ( count( $wgDeferredUpdateList ) ) { - $up = array_pop( $wgDeferredUpdateList ); - $up->doUpdate(); - } - } -} - -# Convert text -if ( $phase == 0 || $phase == 3 ) { - print "\n"; - - $parser = new Parser; - $options = ParserOptions::newFromUser( $wgUser ); - $completedTitles = array(); - $titleChars = Title::legalChars(); - $mediaWiki = $wgLang->getNsText( NS_MEDIAWIKI ); - $template = $wgLang->getNsText( NS_TEMPLATE ); - $linkRegex = "/\[\[$mediaWiki:([$titleChars]*?)\]\]/"; - $msgRegex = "/{{msg:([$titleChars]*?)}}/"; - - foreach ( $targets as $partial => $dummy ) { - $dest = Title::makeTitle( NS_TEMPLATE, $partial ); - $linksTo = $dest->getLinksTo(); - foreach( $linksTo as $source ) { - $pdbk = $source->getPrefixedDBkey(); - print "$pdbk..."; - if ( !array_key_exists( $pdbk, $completedTitles ) ) { - $completedTitles[$pdbk] = 1; - $id = $source->getArticleID(); - $row = wfGetArray( 'cur', array( 'cur_text' ), - array( 'cur_id' => $source->getArticleID() ) ); - $parser->startExternalParse( $source, $options, OT_WIKI ); - $text = $parser->strip( $row->cur_text, $stripState, false ); - # {{msg}} -> {{}} - $text = preg_replace( $msgRegex, "{{\$1}}", $text ); - # [[MediaWiki:]] -> [[Template:]] - $text = preg_replace_callback( $linkRegex, "wfReplaceMediaWiki", $text ); - $text = $parser->unstrip( $text, $stripState ); - if ( $text != $row->cur_text ) { - wfUpdateArray( 'cur', array( 'cur_text' => $text ), array( 'cur_id' => $id ) ); - print "modified\n"; - } else { - print "not modified\n"; - } - } - } - } -} - -#-------------------------------------------------------------------------------------------------------------- -function wfReplaceMediaWiki( $m ) { - global $targets, $template, $replaceCount; - $title = Title::newFromText( $m[1] ); - $partial = $title->getDBkey(); - - if ( array_key_exists( $partial, $targets ) ) { - $text = "[[$template:{$m[1]}]]"; - } else { - $text = $m[0]; - } - return $text; -} ?> diff --git a/maintenance/convertLinks.inc b/maintenance/convertLinks.inc new file mode 100644 index 0000000000..a2acf67eb8 --- /dev/null +++ b/maintenance/convertLinks.inc @@ -0,0 +1,198 @@ +count; + wfFreeResult( $res ); + + if ( $numRows == 0 ) { + print "No rows to convert. Updating schema...\n"; + createTempTable(); + } else { + $row = wfFetchObject( $res ); + if ( is_numeric( $row->l_from ) ) { + print "Schema already converted\n"; + exit; + } + + if ( $logPerformance ) { $fh = fopen ( $perfLogFilename, "w" ); } + $baseTime = $startTime = getMicroTime(); + # Create a title -> cur_id map + print "Loading IDs from cur table...\n"; + performanceLog ( "Reading $numRows rows from cur table...\n" ); + performanceLog ( "rows read vs seconds elapsed:\n" ); + wfBufferSQLResults( false ); + $res = wfQuery( "SELECT cur_namespace,cur_title,cur_id FROM cur", DB_WRITE ); + $ids = array(); + + while ( $row = wfFetchObject( $res ) ) { + $title = $row->cur_title; + if ( $row->cur_namespace ) { + $title = $wgLang->getNsText( $row->cur_namespace ) . ":$title"; + } + $ids[$title] = $row->cur_id; + $curRowsRead++; + if ($reportCurReadProgress) { + if (($curRowsRead % $curReadReportInterval) == 0) { + performanceLog( $curRowsRead . " " . (getMicroTime() - $baseTime) . "\n" ); + print "\t$curRowsRead rows of cur table read.\n"; + } + } + } + wfFreeResult( $res ); + wfBufferSQLResults( true ); + print "Finished loading IDs.\n\n"; + performanceLog( "Took " . (getMicroTime() - $baseTime) . " seconds to load IDs.\n\n" ); + #-------------------------------------------------------------------- + + # Now, step through the links table (in chunks of $linksConvInsertInterval rows), + # convert, and write to the new table. + createTempTable(); + performanceLog( "Resetting timer.\n\n" ); + $baseTime = getMicroTime(); + print "Processing $numRows rows from links table...\n"; + performanceLog( "Processing $numRows rows from links table...\n" ); + performanceLog( "rows inserted vs seconds elapsed:\n" ); + + for ($rowOffset = $initialRowOffset; $rowOffset < $numRows; $rowOffset += $linksConvInsertInterval) { + $sqlRead = "SELECT * FROM links LIMIT $linksConvInsertInterval OFFSET $rowOffset"; + $res = wfQuery($sqlRead, DB_READ); + if ( $noKeys ) { + $sqlWrite = array("INSERT INTO links_temp(l_from,l_to) VALUES "); + } else { + $sqlWrite = array("INSERT IGNORE INTO links_temp(l_from,l_to) VALUES "); + } + + $tuplesAdded = 0; # no tuples added to INSERT yet + while ( $row = wfFetchObject($res) ) { + $fromTitle = $row->l_from; + if ( array_key_exists( $fromTitle, $ids ) ) { # valid title + $from = $ids[$fromTitle]; + $to = $row->l_to; + if ( $tuplesAdded != 0 ) { + $sqlWrite[] = ","; + } + $sqlWrite[] = "($from,$to)"; + $tuplesAdded++; + } else { # invalid title + $numBadLinks++; + } + } + wfFreeResult($res); + #print "rowOffset: $rowOffset\ttuplesAdded: $tuplesAdded\tnumBadLinks: $numBadLinks\n"; + if ( $tuplesAdded != 0 ) { + if ($reportLinksConvProgress) { + print "Inserting $tuplesAdded tuples into links_temp..."; + } + wfQuery( implode("",$sqlWrite) , DB_WRITE ); + $totalTuplesInserted += $tuplesAdded; + if ($reportLinksConvProgress) + print " done. Total $totalTuplesInserted tuples inserted.\n"; + performanceLog( $totalTuplesInserted . " " . (getMicroTime() - $baseTime) . "\n" ); + } + } + print "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n\n"; + performanceLog( "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n" ); + performanceLog( "Total execution time: " . (getMicroTime() - $startTime) . " seconds.\n" ); + if ( $logPerformance ) { fclose ( $fh ); } + } + #-------------------------------------------------------------------- + + if ( $overwriteLinksTable ) { + $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); + if (!($dbConn->isOpen())) { + print "Opening connection to database failed.\n"; + exit; + } + # Check for existing links_backup, and delete it if it exists. + print "Dropping backup links table if it exists..."; + $dbConn->query( "DROP TABLE IF EXISTS links_backup", DB_WRITE); + print " done.\n"; + + # Swap in the new table, and move old links table to links_backup + print "Swapping tables 'links' to 'links_backup'; 'links_temp' to 'links'..."; + $dbConn->query( "RENAME TABLE links TO links_backup, links_temp TO links", DB_WRITE ); + print " done.\n\n"; + + $dbConn->close(); + print "Conversion complete. The old table remains at links_backup;\n"; + print "delete at your leisure.\n"; + } else { + print "Conversion complete. The converted table is at links_temp;\n"; + print "the original links table is unchanged.\n"; + } + +#-------------------------------------------------------------------- + +function createTempTable() { + global $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; + global $noKeys; + $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); + + if (!($dbConn->isOpen())) { + print "Opening connection to database failed.\n"; + exit; + } + + print "Dropping temporary links table if it exists..."; + $dbConn->query( "DROP TABLE IF EXISTS links_temp", DB_WRITE); + print " done.\n"; + + print "Creating temporary links table..."; + if ( $noKeys ) { + $dbConn->query( "CREATE TABLE links_temp ( " . + "l_from int(8) unsigned NOT NULL default '0', " . + "l_to int(8) unsigned NOT NULL default '0')", DB_WRITE); + } else { + $dbConn->query( "CREATE TABLE links_temp ( " . + "l_from int(8) unsigned NOT NULL default '0', " . + "l_to int(8) unsigned NOT NULL default '0', " . + "UNIQUE KEY l_from(l_from,l_to), " . + "KEY (l_to))", DB_WRITE); + } + print " done.\n\n"; +} + +function performanceLog( $text ) { + global $logPerformance, $fh; + if ( $logPerformance ) { + fwrite( $fh, $text ); + } +} + +function getMicroTime() { # return time in seconds, with microsecond accuracy + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec + (float)$sec); +} + + + +?> diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index 8e3bb51799..62b41eb630 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -5,194 +5,8 @@ require_once( "commandLine.inc" ); # the below should probably be moved into commandLine.inc at some point require_once( "../AdminSettings.php" ); +require_once( "convertLinks.inc" ); -$numRows = $tuplesAdded = $numBadLinks = $curRowsRead = 0; #counters etc -$totalTuplesInserted = 0; # total tuples INSERTed into links_temp +convertLinks(); -$reportCurReadProgress = true; #whether or not to give progress reports while reading IDs from cur table -$curReadReportInterval = 1000; #number of rows between progress reports - -$reportLinksConvProgress = true; #whether or not to give progress reports during conversion -$linksConvInsertInterval = 1000; #number of rows per INSERT - -$initialRowOffset = 0; -#$finalRowOffset = 0; # not used yet; highest row number from links table to process - -# Overwrite the old links table with the new one. If this is set to false, -# the new table will be left at links_temp. -$overwriteLinksTable = true; - -# Don't create keys, and so allow duplicates in the new links table. -# This gives a huge speed improvement for very large links tables which are MyISAM. (What about InnoDB?) -$noKeys = false; - - -$logPerformance = false; # output performance data to a file -$perfLogFilename = "convLinksPerf.txt"; -#-------------------------------------------------------------------- - -$res = wfQuery( "SELECT COUNT(*) AS count FROM links", DB_WRITE ); -$row = wfFetchObject($res); -$numRows = $row->count; -wfFreeResult( $res ); - -if ( $numRows == 0 ) { - print "No rows to convert. Updating schema...\n"; - createTempTable(); -} else { - $row = wfFetchObject( $res ); - if ( is_numeric( $row->l_from ) ) { - print "Schema already converted\n"; - exit; - } - - if ( $logPerformance ) { $fh = fopen ( $perfLogFilename, "w" ); } - $baseTime = $startTime = getMicroTime(); - # Create a title -> cur_id map - print "Loading IDs from cur table...\n"; - performanceLog ( "Reading $numRows rows from cur table...\n" ); - performanceLog ( "rows read vs seconds elapsed:\n" ); - wfBufferSQLResults( false ); - $res = wfQuery( "SELECT cur_namespace,cur_title,cur_id FROM cur", DB_WRITE ); - $ids = array(); - - while ( $row = wfFetchObject( $res ) ) { - $title = $row->cur_title; - if ( $row->cur_namespace ) { - $title = $wgLang->getNsText( $row->cur_namespace ) . ":$title"; - } - $ids[$title] = $row->cur_id; - $curRowsRead++; - if ($reportCurReadProgress) { - if (($curRowsRead % $curReadReportInterval) == 0) { - performanceLog( $curRowsRead . " " . (getMicroTime() - $baseTime) . "\n" ); - print "\t$curRowsRead rows of cur table read.\n"; - } - } - } - wfFreeResult( $res ); - wfBufferSQLResults( true ); - print "Finished loading IDs.\n\n"; - performanceLog( "Took " . (getMicroTime() - $baseTime) . " seconds to load IDs.\n\n" ); -#-------------------------------------------------------------------- - - # Now, step through the links table (in chunks of $linksConvInsertInterval rows), - # convert, and write to the new table. - createTempTable(); - performanceLog( "Resetting timer.\n\n" ); - $baseTime = getMicroTime(); - print "Processing $numRows rows from links table...\n"; - performanceLog( "Processing $numRows rows from links table...\n" ); - performanceLog( "rows inserted vs seconds elapsed:\n" ); - - for ($rowOffset = $initialRowOffset; $rowOffset < $numRows; $rowOffset += $linksConvInsertInterval) { - $sqlRead = "SELECT * FROM links LIMIT $linksConvInsertInterval OFFSET $rowOffset"; - $res = wfQuery($sqlRead, DB_READ); - if ( $noKeys ) { - $sqlWrite = array("INSERT INTO links_temp(l_from,l_to) VALUES "); - } else { - $sqlWrite = array("INSERT IGNORE INTO links_temp(l_from,l_to) VALUES "); - } - - $tuplesAdded = 0; # no tuples added to INSERT yet - while ( $row = wfFetchObject($res) ) { - $fromTitle = $row->l_from; - if ( array_key_exists( $fromTitle, $ids ) ) { # valid title - $from = $ids[$fromTitle]; - $to = $row->l_to; - if ( $tuplesAdded != 0 ) { - $sqlWrite[] = ","; - } - $sqlWrite[] = "($from,$to)"; - $tuplesAdded++; - } else { # invalid title - $numBadLinks++; - } - } - wfFreeResult($res); - #print "rowOffset: $rowOffset\ttuplesAdded: $tuplesAdded\tnumBadLinks: $numBadLinks\n"; - if ( $tuplesAdded != 0 ) { - if ($reportLinksConvProgress) { - print "Inserting $tuplesAdded tuples into links_temp..."; - } - wfQuery( implode("",$sqlWrite) , DB_WRITE ); - $totalTuplesInserted += $tuplesAdded; - if ($reportLinksConvProgress) - print " done. Total $totalTuplesInserted tuples inserted.\n"; - performanceLog( $totalTuplesInserted . " " . (getMicroTime() - $baseTime) . "\n" ); - } - } - print "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n\n"; - performanceLog( "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n" ); - performanceLog( "Total execution time: " . (getMicroTime() - $startTime) . " seconds.\n" ); - if ( $logPerformance ) { fclose ( $fh ); } -} -#-------------------------------------------------------------------- - -if ( $overwriteLinksTable ) { - $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); - if (!($dbConn->isOpen())) { - print "Opening connection to database failed.\n"; - exit; - } - # Check for existing links_backup, and delete it if it exists. - print "Dropping backup links table if it exists..."; - $dbConn->query( "DROP TABLE IF EXISTS links_backup", DB_WRITE); - print " done.\n"; - - # Swap in the new table, and move old links table to links_backup - print "Swapping tables 'links' to 'links_backup'; 'links_temp' to 'links'..."; - $dbConn->query( "RENAME TABLE links TO links_backup, links_temp TO links", DB_WRITE ); - print " done.\n\n"; - - $dbConn->close(); - print "Conversion complete. The old table remains at links_backup;\n"; - print "delete at your leisure.\n"; -} else { - print "Conversion complete. The converted table is at links_temp;\n"; - print "the original links table is unchanged.\n"; -} - -#-------------------------------------------------------------------- - -function createTempTable() { - global $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; - global $noKeys; - $dbConn = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname ); - - if (!($dbConn->isOpen())) { - print "Opening connection to database failed.\n"; - exit; - } - - print "Dropping temporary links table if it exists..."; - $dbConn->query( "DROP TABLE IF EXISTS links_temp", DB_WRITE); - print " done.\n"; - - print "Creating temporary links table..."; - if ( $noKeys ) { - $dbConn->query( "CREATE TABLE links_temp ( " . - "l_from int(8) unsigned NOT NULL default '0', " . - "l_to int(8) unsigned NOT NULL default '0')", DB_WRITE); - } else { - $dbConn->query( "CREATE TABLE links_temp ( " . - "l_from int(8) unsigned NOT NULL default '0', " . - "l_to int(8) unsigned NOT NULL default '0', " . - "UNIQUE KEY l_from(l_from,l_to), " . - "KEY (l_to))", DB_WRITE); - } - print " done.\n\n"; -} - -function performanceLog( $text ) { - global $logPerformance, $fh; - if ( $logPerformance ) { - fwrite( $fh, $text ); - } -} - -function getMicroTime() { # return time in seconds, with microsecond accuracy - list($usec, $sec) = explode(" ", microtime()); - return ((float)$usec + (float)$sec); -} ?> diff --git a/maintenance/trivialCmdLine.php b/maintenance/trivialCmdLine.php new file mode 100644 index 0000000000..51628bc983 --- /dev/null +++ b/maintenance/trivialCmdLine.php @@ -0,0 +1,11 @@ +m}\n"; + +?> diff --git a/maintenance/update2.php b/maintenance/update2.php new file mode 100644 index 0000000000..afd07e0a91 --- /dev/null +++ b/maintenance/update2.php @@ -0,0 +1,39 @@ + -- 2.20.1 From dd74ff399ad7616640252a03519c1f6c79f1d8b9 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 22 May 2004 04:53:02 +0000 Subject: [PATCH 15/16] Fixed 1.2 compatibility in "skin" user option --- includes/User.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/User.php b/includes/User.php index 111bebff1a..41526571c7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -468,10 +468,14 @@ class User { if ( !isset( $skinNames[$s] ) ) { $fallback = array( - 'standard' => "Standard", - 'nostalgia' => "Nostalgia", - 'cologneblue' => "Cologne Blue"); - if(is_int($s) && isset( $fallback[$s]) ){ + 0 => "SkinStandard", + 1 => "SkinNostalgia", + 2 => "SkinCologneBlue"); + if ( isset( $skinNames['monobook'] ) ) { + $fallback[0] = "SkinMonoBook"; + } + + if(is_numeric($s) && isset( $fallback[$s]) ){ $sn = $fallback[$s]; } else { $sn = "SkinStandard"; -- 2.20.1 From caf82594f5edde725bfe817279e2dfa03db336d1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 22 May 2004 07:05:45 +0000 Subject: [PATCH 16/16] 1.2 -> 1.3 conversion using the web-based installer --- config/index.php | 54 +++++++++++++++------ maintenance/archives/moveCustomMessages.inc | 6 +++ maintenance/convertLinks.inc | 3 ++ 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/config/index.php b/config/index.php index 16d17a2f71..ad1cc16358 100644 --- a/config/index.php +++ b/config/index.php @@ -153,6 +153,9 @@ if( !is_writable( "." ) ) { require( "../install-utils.inc" ); require( "../maintenance/updaters.inc" ); +require( "../maintenance/convertLinks.inc" ); +require( "../maintenance/archives/moveCustomMessages.inc" ); + class ConfigData { function getEncoded( $data ) { # Hackish @@ -399,11 +402,20 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { do_linkscc_update(); flush(); do_hitcounter_update(); flush(); do_recentchanges_update(); flush(); - echo "FIXME: need the link table change here\n"; + convertLinks(); flush(); do_user_real_name_update(); flush(); do_querycache_update(); flush(); do_objectcache_update(); flush(); do_categorylinks_update(); flush(); + + if ( isTemplateInitialised() ) { + print "Template namespace already initialised\n"; + } else { + moveCustomMessages( 1 ); flush(); + moveCustomMessages( 2 ); flush(); + moveCustomMessages( 3 ); flush(); + } + initialiseMessages(); flush(); chdir( "config" ); @@ -686,8 +698,19 @@ function writeLocalSettings( $conf ) { $pretty = ($conf->prettyURLs ? "" : "# "); $ugly = ($conf->prettyURLs ? "# " : ""); $rights = ($conf->RightsUrl) ? "" : "# "; + + $file = @fopen( "/dev/random", "r" ); + if ( $file ) { + $proxyKey = bin2hex( fread( $file, 32 ) ); + fclose( $file ); + } else { + $proxyKey = ""; + for ( $i=0; $i<8; $i++ ) { + $proxyKey .= dechex(mt_rand(0, 0x7fffffff)); + } + print "Warning: \$wgProxyKey is insecure\n"; + } -# $proxyKey = Parser::getRandomString() . Parser::getRandomString(); # Add slashes to strings for double quoting $slconf = array_map( "addslashes", get_object_vars( $conf ) ); @@ -698,7 +721,7 @@ function writeLocalSettings( $conf ) { # If you make manual changes, please keep track in case you need to # recreate them later. -\$IP = \"{$slconf[IP]}\"; +\$IP = \"{$slconf['IP']}\"; ini_set( \"include_path\", \"\$IP/includes$sep\$IP/languages$sep\" . ini_get(\"include_path\") ); include_once( \"DefaultSettings.php\" ); @@ -711,9 +734,9 @@ if ( \$wgCommandLineMode ) { {$zlib}if( !ini_get( 'zlib.output_compression' ) ) ob_start( 'ob_gzhandler' ); } -\$wgSitename = \"{$slconf[Sitename]}\"; +\$wgSitename = \"{$slconf['Sitename']}\"; -\$wgScriptPath = \"{$slconf[ScriptPath]}\"; +\$wgScriptPath = \"{$slconf['ScriptPath']}\"; \$wgScript = \"\$wgScriptPath/index.php\"; \$wgRedirectScript = \"\$wgScriptPath/redirect.php\"; @@ -728,13 +751,13 @@ if ( \$wgCommandLineMode ) { \$wgUploadPath = \"\$wgScriptPath/images\"; \$wgUploadDirectory = \"\$IP/images\"; -\$wgEmergencyContact = \"{$slconf[EmergencyContact]}\"; -\$wgPasswordSender = \"{$slconf[PasswordSender]}\"; +\$wgEmergencyContact = \"{$slconf['EmergencyContact']}\"; +\$wgPasswordSender = \"{$slconf['PasswordSender']}\"; -\$wgDBserver = \"{$slconf[DBserver]}\"; -\$wgDBname = \"{$slconf[DBname]}\"; -\$wgDBuser = \"{$slconf[DBuser]}\"; -\$wgDBpassword = \"{$slconf[DBpassword]}\"; +\$wgDBserver = \"{$slconf['DBserver']}\"; +\$wgDBname = \"{$slconf['DBname']}\"; +\$wgDBuser = \"{$slconf['DBuser']}\"; +\$wgDBpassword = \"{$slconf['DBpassword']}\"; ## To allow SQL queries through the wiki's Special:Askaql page, ## uncomment the next lines. THIS IS VERY INSECURE. If you want @@ -764,16 +787,15 @@ if ( \$wgCommandLineMode ) { \$wgLocalInterwiki = \$wgSitename; -\$wgLanguageCode = \"{$slconf[LanguageCode]}\"; -" . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$slconf[Encoding]}\";" : "" ) . " +\$wgLanguageCode = \"{$slconf['LanguageCode']}\"; +" . ($conf->Encoding ? "\$wgInputEncoding = \$wgOutputEncoding = \"{$slconf['Encoding']}\";" : "" ) . " + +\$wgProxyKey = \"$proxyKey\"; ## Default skin: you can change the default skin. Use the internal symbolic ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook': # \$wgDefaultSkin = 'monobook'; -## This is incomplete, ignore it: -#\$wgProxyKey = $proxyKey; - ## For attaching licensing metadata to pages, and displaying an ## appropriate copyright notice / icon. GNU Free Documentation ## License and Creative Commons licenses are supported so far. diff --git a/maintenance/archives/moveCustomMessages.inc b/maintenance/archives/moveCustomMessages.inc index 8ad118d6c7..dd5e8aee82 100644 --- a/maintenance/archives/moveCustomMessages.inc +++ b/maintenance/archives/moveCustomMessages.inc @@ -1,5 +1,11 @@