From: Brion Vibber Date: Mon, 13 Oct 2008 00:08:44 +0000 (+0000) Subject: Back out r41786 for now "(bug 9226) Fetch restrictions properly on export" X-Git-Tag: 1.31.0-rc.0~44773 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7c130df66fa7c38927109174ee4e99c0906177a9;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/Export.php b/includes/Export.php index 72e8f1e5c9..827561e7e9 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -425,20 +425,13 @@ class XmlDumpWriter { * @access private */ function openPage( $row ) { - global $wgRestrictionTypes; $out = " \n"; $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $out .= ' ' . wfElementClean( 'title', array(), $title->getPrefixedText() ) . "\n"; $out .= ' ' . wfElement( 'id', array(), strval( $row->page_id ) ) . "\n"; - # Get page restrictions - $restrictions = array(); - foreach( $wgRestrictionTypes as $action ) { - $restrictions[$action] = implode( '', $title->getRestrictions( $action ) ); - } - $restrictions = Article::flattenRestrictions( $restrictions ); - if( '' != $restrictions ) { - $out .= ' ' . wfElement( 'restrictions', array(), - strval( $restrictions ) ) . "\n"; + if( '' != $row->page_restrictions ) { + $out .= ' ' . wfElement( 'restrictions', array(), + strval( $row->page_restrictions ) ) . "\n"; } return $out; }