*/
public function showResults( $term ) {
global $wgDisableTextSearch, $wgSearchForwardUrl, $wgContLang, $wgScript;
- wfProfileIn( __METHOD__ );
+ $profile = new ProfileSection( __METHOD__ );
$search = $this->getSearchEngine();
$search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
Xml::closeElement( 'fieldset' )
);
}
- wfProfileOut( __METHOD__ );
return;
}
if ( !wfRunHooks( 'SpecialSearchResultsPrepend', array( $this, $out, $term ) ) ) {
# Hook requested termination
- wfProfileOut( __METHOD__ );
return;
}
// Sometimes the search engine knows there are too many hits
if ( $titleMatches instanceof SearchResultTooMany ) {
$out->wrapWikiMsg( "==$1==\n", 'toomanymatches' );
- wfProfileOut( __METHOD__ );
return;
}
$out->addHtml( $this->getProfileForm( $this->profile, $term ) );
$out->addHTML( '</form>' );
// Empty query -- straight view of search form
- wfProfileOut( __METHOD__ );
return;
}
$out->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
}
wfRunHooks( 'SpecialSearchResultsAppend', array( $this, $out, $term ) );
- wfProfileOut( __METHOD__ );
}
/**
*/
protected function showMatches( &$matches ) {
global $wgContLang;
- wfProfileIn( __METHOD__ );
+ $profile = new ProfileSection( __METHOD__ );
$terms = $wgContLang->convertForSearchResult( $matches->termMatches() );
$out = "<ul class='mw-search-results'>\n";
// convert the whole thing to desired language variant
$out = $wgContLang->convert( $out );
- wfProfileOut( __METHOD__ );
+
return $out;
}
* @return string
*/
protected function showHit( $result, $terms ) {
- wfProfileIn( __METHOD__ );
+ $profile = new ProfileSection( __METHOD__ );
if ( $result->isBrokenTitle() ) {
- wfProfileOut( __METHOD__ );
return "<!-- Broken link in search result -->\n";
}
//This is not quite safe, but better than showing excerpts from non-readable pages
//Note that hiding the entry entirely would screw up paging.
if ( !$t->userCan( 'read', $this->getUser() ) ) {
- wfProfileOut( __METHOD__ );
return "<li>{$link}</li>\n";
}
// The least confusing at this point is to drop the result.
// You may get less results, but... oh well. :P
if ( $result->isMissingRevision() ) {
- wfProfileOut( __METHOD__ );
return "<!-- missing page " . htmlspecialchars( $t->getPrefixedText() ) . "-->\n";
}
$thumb = $img->transform( array( 'width' => 120, 'height' => 120 ) );
if ( $thumb ) {
$desc = $this->msg( 'parentheses' )->rawParams( $img->getShortDesc() )->escaped();
- wfProfileOut( __METHOD__ );
// Float doesn't seem to interact well with the bullets.
// Table messes up vertical alignment of the bullets.
// Bullets are therefore disabled (didn't look great anyway).
"</li>\n";
}
- wfProfileOut( __METHOD__ );
return $html;
}
*/
protected function showInterwiki( $matches, $query ) {
global $wgContLang;
- wfProfileIn( __METHOD__ );
+
+ $profile = new ProfileSection( __METHOD__ );
$terms = $wgContLang->convertForSearchResult( $matches->termMatches() );
$out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>" .
// convert the whole thing to desired language variant
$out = $wgContLang->convert( $out );
- wfProfileOut( __METHOD__ );
+
return $out;
}
* @return string
*/
protected function showInterwikiHit( $result, $lastInterwiki, $terms, $query, $customCaptions ) {
- wfProfileIn( __METHOD__ );
+ $profile = new ProfileSection( __METHOD__ );
if ( $result->isBrokenTitle() ) {
- wfProfileOut( __METHOD__ );
return "<!-- Broken link in search result -->\n";
}
}
$out .= "<li>{$link} {$redirect}</li>\n";
- wfProfileOut( __METHOD__ );
return $out;
}