r42007 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42006‎ | r42007 | r42008 >
Date:00:08, 13 October 2008
Author:brion
Status:old
Tags:
Comment:
Back out r41786 for now "(bug 9226) Fetch restrictions properly on export"
Per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/41786#c121:

Issues:

1. Restriction fetches may not be synchronous with original start in a long-running export
2. Looks like this adds an SQL query to slave for every single page
3. In case of timed-out DB connections or a dying slave, this might break a long-running dump process
Modified paths:
  • /trunk/phase3/includes/Export.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -425,21 +425,14 @@
426426 * @access private
427427 */
428428 function openPage( $row ) {
429 - global $wgRestrictionTypes;
430429 $out = " <page>\n";
431430 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
432431 $out .= ' ' . wfElementClean( 'title', array(), $title->getPrefixedText() ) . "\n";
433432 $out .= ' ' . wfElement( 'id', array(), strval( $row->page_id ) ) . "\n";
434 - # Get page restrictions
435 - $restrictions = array();
436 - foreach( $wgRestrictionTypes as $action ) {
437 - $restrictions[$action] = implode( '', $title->getRestrictions( $action ) );
 433+ if( '' != $row->page_restrictions ) {
 434+ $out .= ' ' . wfElement( 'restrictions', array(),
 435+ strval( $row->page_restrictions ) ) . "\n";
438436 }
439 - $restrictions = Article::flattenRestrictions( $restrictions );
440 - if( '' != $restrictions ) {
441 - $out .= ' ' . wfElement( 'restrictions', array(),
442 - strval( $restrictions ) ) . "\n";
443 - }
444437 return $out;
445438 }
446439

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41786(bug 9226) Fetch restrictions properly on exportaaron23:51, 6 October 2008

Status & tagging log