r12602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12601‎ | r12602 | r12603 >
Date:06:33, 11 January 2006
Author:timstarling
Status:old
Tags:
Comment:
Do the checks for template existence in a batch
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -997,6 +997,14 @@
998998 $outText = '';
999999 $templates = $this->mArticle->getUsedTemplates();
10001000 if ( count( $templates ) > 0 ) {
 1001+ # Do a batch existence check
 1002+ $batch = new LinkBatch;
 1003+ foreach( $templates as $title ) {
 1004+ $batch->addObj( $title );
 1005+ }
 1006+ $batch->execute();
 1007+
 1008+ # Construct the HTML
10011009 $outText = '<br />'. wfMsg( 'templatesused' ) . '<ul>';
10021010 foreach ( $templates as $titleObj ) {
10031011 $outText .= '<li>' . $sk->makeLinkObj( $titleObj ) . '</li>';

Status & tagging log