'SearchHighlighter' => __DIR__ . '/includes/search/SearchHighlighter.php',
'SearchMssql' => __DIR__ . '/includes/search/SearchMssql.php',
'SearchMySQL' => __DIR__ . '/includes/search/SearchMySQL.php',
- 'SearchNearMatchResultSet' => __DIR__ . '/includes/search/SearchResultSet.php',
+ 'SearchNearMatchResultSet' => __DIR__ . '/includes/search/SearchNearMatchResultSet.php',
'SearchOracle' => __DIR__ . '/includes/search/SearchOracle.php',
'SearchPostgres' => __DIR__ . '/includes/search/SearchPostgres.php',
'SearchResult' => __DIR__ . '/includes/search/SearchResult.php',
'SpecialWhatLinksHere' => __DIR__ . '/includes/specials/SpecialWhatlinkshere.php',
'SqlBagOStuff' => __DIR__ . '/includes/objectcache/SqlBagOStuff.php',
'SqlDataUpdate' => __DIR__ . '/includes/deferred/SqlDataUpdate.php',
- 'SqlSearchResultSet' => __DIR__ . '/includes/search/SearchResultSet.php',
+ 'SqlSearchResultSet' => __DIR__ . '/includes/search/SqlSearchResultSet.php',
'Sqlite' => __DIR__ . '/maintenance/sqlite.inc',
'SqliteInstaller' => __DIR__ . '/includes/installer/SqliteInstaller.php',
'SqliteMaintenance' => __DIR__ . '/maintenance/sqlite.php',
--- /dev/null
+<?php
+/**
+ * A SearchResultSet wrapper for SearchEngine::getNearMatch
+ */
+class SearchNearMatchResultSet extends SearchResultSet {
+ private $fetched = false;
+
+ /**
+ * @param Title|null $match Title if matched, else null
+ */
+ public function __construct( $match ) {
+ $this->result = $match;
+ }
+
+ public function numRows() {
+ return $this->result ? 1 : 0;
+ }
+
+ public function next() {
+ if ( $this->fetched || !$this->result ) {
+ return false;
+ }
+ $this->fetched = true;
+ return SearchResult::newFromTitle( $this->result );
+ }
+}
return $this->containedSyntax;
}
}
-
-/**
- * This class is used for different SQL-based search engines shipped with MediaWiki
- * @ingroup Search
- */
-class SqlSearchResultSet extends SearchResultSet {
- protected $resultSet;
- protected $terms;
- protected $totalHits;
-
- function __construct( $resultSet, $terms, $total = null ) {
- $this->resultSet = $resultSet;
- $this->terms = $terms;
- $this->totalHits = $total;
- }
-
- function termMatches() {
- return $this->terms;
- }
-
- function numRows() {
- if ( $this->resultSet === false ) {
- return false;
- }
-
- return $this->resultSet->numRows();
- }
-
- function next() {
- if ( $this->resultSet === false ) {
- return false;
- }
-
- $row = $this->resultSet->fetchObject();
- if ( $row === false ) {
- return false;
- }
-
- return SearchResult::newFromTitle(
- Title::makeTitle( $row->page_namespace, $row->page_title )
- );
- }
-
- function free() {
- if ( $this->resultSet === false ) {
- return false;
- }
-
- $this->resultSet->free();
- }
-
- function getTotalHits() {
- if ( !is_null( $this->totalHits ) ) {
- return $this->totalHits;
- } else {
- // Special:Search expects a number here.
- return $this->numRows();
- }
- }
-}
-
-/**
- * A SearchResultSet wrapper for SearchEngine::getNearMatch
- */
-class SearchNearMatchResultSet extends SearchResultSet {
- private $fetched = false;
-
- /**
- * @param Title|null $match Title if matched, else null
- */
- public function __construct( $match ) {
- $this->result = $match;
- }
-
- public function numRows() {
- return $this->result ? 1 : 0;
- }
-
- public function next() {
- if ( $this->fetched || !$this->result ) {
- return false;
- }
- $this->fetched = true;
- return SearchResult::newFromTitle( $this->result );
- }
-}
--- /dev/null
+<?php
+/**
+ * This class is used for different SQL-based search engines shipped with MediaWiki
+ * @ingroup Search
+ */
+class SqlSearchResultSet extends SearchResultSet {
+ protected $resultSet;
+ protected $terms;
+ protected $totalHits;
+
+ function __construct( $resultSet, $terms, $total = null ) {
+ $this->resultSet = $resultSet;
+ $this->terms = $terms;
+ $this->totalHits = $total;
+ }
+
+ function termMatches() {
+ return $this->terms;
+ }
+
+ function numRows() {
+ if ( $this->resultSet === false ) {
+ return false;
+ }
+
+ return $this->resultSet->numRows();
+ }
+
+ function next() {
+ if ( $this->resultSet === false ) {
+ return false;
+ }
+
+ $row = $this->resultSet->fetchObject();
+ if ( $row === false ) {
+ return false;
+ }
+
+ return SearchResult::newFromTitle(
+ Title::makeTitle( $row->page_namespace, $row->page_title )
+ );
+ }
+
+ function free() {
+ if ( $this->resultSet === false ) {
+ return false;
+ }
+
+ $this->resultSet->free();
+ }
+
+ function getTotalHits() {
+ if ( !is_null( $this->totalHits ) ) {
+ return $this->totalHits;
+ } else {
+ // Special:Search expects a number here.
+ return $this->numRows();
+ }
+ }
+}