r13169 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13168‎ | r13169 | r13170 >
Date:03:11, 5 March 2006
Author:timstarling
Status:old
Tags:
Comment:
Don't include core files from LocalSettings.php. A few other tweaks.
Modified paths:
  • /trunk/extensions/LuceneSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LuceneSearch.php
@@ -42,10 +42,11 @@
4343 $wgLuceneDisableTitleMatches = false;
4444
4545 # Not a valid entry point, skip unless MEDIAWIKI is defined
46 -require_once('SearchEngine.php');
47 -require_once('Article.php');
 46+if (!defined('MEDIAWIKI')) {
 47+ die( "This file is part of MediaWiki, it is not a valid entry point\n" );
 48+}
 49+
4850
49 -if (defined('MEDIAWIKI')) {
5051 $wgExtensionFunctions[] = 'wfLuceneSearch';
5152 $wgExtensionCredits['specialpage'][] = array(
5253 'name' => 'LuceneSearch',
@@ -63,6 +64,7 @@
6465
6566 global $IP;
6667 require_once( $IP.'/includes/SpecialPage.php');
 68+require_once($IP.'/includes/SearchEngine.php');
6769
6870 class LuceneSearch extends SpecialPage
6971 {
@@ -115,7 +117,7 @@
116118 $fname = 'LuceneSearch::execute';
117119 wfProfileIn( $fname );
118120 $this->setHeaders();
119 -$wgOut->addHTML('<!-- titlens = '. $wgTitle->getNamespace() . '-->');
 121+ $wgOut->addHTML('<!-- titlens = '. $wgTitle->getNamespace() . '-->');
120122
121123 foreach(SearchEngine::searchableNamespaces() as $ns => $name)
122124 if ($wgRequest->getCheck('ns' . $ns))
@@ -789,24 +791,25 @@
790792
791793 global $wgMessageCache;
792794 SpecialPage::addPage(new LuceneSearch);
793 -$wgMessageCache->addMessage('searchnumber', "<strong>Results $1-$2 of $3</strong>");
794 -$wgMessageCache->addMessage('searchprev', "&#x00AB; <span style='font-size: small'>Prev</span>");
795 -$wgMessageCache->addMessage('searchnext', "<span style='font-size: small'>Next</span> &#x00BB;");
796 -$wgMessageCache->addMessage('searchscore', "Relevancy: $1");
797 -$wgMessageCache->addMessage('searchsize', "$1KB ($2 words)");
798 -$wgMessageCache->addMessage('searchdidyoumean', "Did you mean: \"<a href=\"$1\">$2</a>\"?");
799 -$wgMessageCache->addMessage('searchnoresults', "Sorry, there were no exact matches to your query.");
800 -$wgMessageCache->addMessage('searchnearmatches', "<b>These pages have similar titles to your query:</b>\n");
801 -$wgMessageCache->addMessage('searchnearmatch', "<li>$1</li>\n");
802 -$wgMessageCache->addMessage('lucenepowersearchtext', "
 795+$wgMessageCache->addMessages(array(
 796+ 'searchnumber' => "<strong>Results $1-$2 of $3</strong>",
 797+ 'searchprev' => "&#x00AB; <span style='font-size: small'>Prev</span>",
 798+ 'searchnext' => "<span style='font-size: small'>Next</span> &#x00BB;",
 799+ 'searchscore' => "Relevancy: $1",
 800+ 'searchsize' => "$1KB ($2 words)",
 801+ 'searchdidyoumean' => "Did you mean: \"<a href=\"$1\">$2</a>\"?",
 802+ 'searchnoresults' => "Sorry, there were no exact matches to your query.",
 803+ 'searchnearmatches' => "<b>These pages have similar titles to your query:</b>\n",
 804+ 'searchnearmatch' => "<li>$1</li>\n",
 805+ 'lucenepowersearchtext', "
803806 Search in namespaces:\n
804807 $1\n
805 -Search for $3 $9");
806 -$wgMessageCache->addMessage( "lucenefallback",
 808+Search for $3 $9",
 809+ 'lucenefallback' =>
807810 "There was a problem with the wiki search.
808811 This is probably temporary; try again in a few moments,
809 -or you can search the wiki through an external search service:\n");
 812+or you can search the wiki through an external search service:\n"
 813+));
810814
811815 } # End of extension function
812 -} # End of invocation guard
813816 ?>

Status & tagging log