'RevisionDeleteUser' => 'includes/revisiondelete/RevisionDeleteUser.php',
# includes/search
- 'MssqlSearchResultSet' => 'includes/search/SearchMssql.php',
- 'MySQLSearchResultSet' => 'includes/search/SearchMySQL.php',
'PostgresSearchResult' => 'includes/search/SearchPostgres.php',
'PostgresSearchResultSet' => 'includes/search/SearchPostgres.php',
'SearchDatabase' => 'includes/search/SearchDatabase.php',
'SearchResultSet' => 'includes/search/SearchResultSet.php',
'SearchResultTooMany' => 'includes/search/SearchEngine.php',
'SearchSqlite' => 'includes/search/SearchSqlite.php',
- 'SqliteSearchResultSet' => 'includes/search/SearchSqlite.php',
'SqlSearchResultSet' => 'includes/search/SearchResultSet.php',
# includes/site
* Perform a full text search query and return a result set.
*
* @param string $term Raw search term
- * @return MssqlSearchResultSet
+ * @return SqlSearchResultSet
* @access public
*/
function searchText( $term ) {
$resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), true ) ) );
- return new MssqlSearchResultSet( $resultSet, $this->searchTerms );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
/**
* Perform a title-only search query and return a result set.
*
* @param string $term Raw search term
- * @return MssqlSearchResultSet
+ * @return SqlSearchResultSet
* @access public
*/
function searchTitle( $term ) {
$resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) );
- return new MssqlSearchResultSet( $resultSet, $this->searchTerms );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
/**
return $this->db->query( $sql, 'SearchMssql::updateTitle' );
}
}
-
-/**
- * @ingroup Search
- */
-class MssqlSearchResultSet extends SearchResultSet {
- function __construct( $resultSet, $terms ) {
- $this->mResultSet = $resultSet;
- $this->mTerms = $terms;
- }
-
- function termMatches() {
- return $this->mTerms;
- }
-
- function numRows() {
- return $this->mResultSet->numRows();
- }
-
- function next() {
- $row = $this->mResultSet->fetchObject();
- if ( $row === false ) {
- return false;
- }
- return new SearchResult( $row );
- }
-}
* Perform a full text search query and return a result set.
*
* @param string $term Raw search term
- * @return MySQLSearchResultSet
+ * @return SqlSearchResultSet
*/
function searchText( $term ) {
return $this->searchInternal( $term, true );
* Perform a title-only search query and return a result set.
*
* @param string $term Raw search term
- * @return MySQLSearchResultSet
+ * @return SqlSearchResultSet
*/
function searchTitle( $term ) {
return $this->searchInternal( $term, false );
$totalResult->free();
}
- return new MySQLSearchResultSet( $resultSet, $this->searchTerms, $total );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms, $total );
}
public function supports( $feature ) {
return self::$mMinSearchLength;
}
}
-
-/**
- * @ingroup Search
- */
-class MySQLSearchResultSet extends SqlSearchResultSet {
- function __construct( $resultSet, $terms, $totalHits = null ) {
- parent::__construct( $resultSet, $terms );
- $this->mTotalHits = $totalHits;
- }
-
- function getTotalHits() {
- return $this->mTotalHits;
- }
-}
}
$resultSet = $this->db->resultObject( $this->db->query( $this->getQuery( $this->filter( $term ), false ) ) );
- return new MySQLSearchResultSet( $resultSet, $this->searchTerms );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms );
}
/**
* @ingroup Search
*/
class PostgresSearchResultSet extends SqlSearchResultSet {
- function __construct( $resultSet, $terms ) {
- parent::__construct( $resultSet, $terms );
- }
-
function next() {
- $row = $this->mResultSet->fetchObject();
+ $row = $this->resultSet->fetchObject();
if ( $row === false ) {
return false;
} else {
* @ingroup Search
*/
class SqlSearchResultSet extends SearchResultSet {
+ protected $resultSet;
+ protected $terms;
+ protected $totalHits;
- protected $mResultSet;
-
- function __construct( $resultSet, $terms ) {
- $this->mResultSet = $resultSet;
- $this->mTerms = $terms;
+ function __construct( $resultSet, $terms, $total = null ) {
+ $this->resultSet = $resultSet;
+ $this->terms = $terms;
+ $this->totalHits = $total;
}
function termMatches() {
- return $this->mTerms;
+ return $this->terms;
}
function numRows() {
- if ( $this->mResultSet === false ) {
+ if ( $this->resultSet === false ) {
return false;
}
- return $this->mResultSet->numRows();
+ return $this->resultSet->numRows();
}
function next() {
- if ( $this->mResultSet === false ) {
+ if ( $this->resultSet === false ) {
return false;
}
- $row = $this->mResultSet->fetchObject();
+ $row = $this->resultSet->fetchObject();
if ( $row === false ) {
return false;
}
}
function free() {
- if ( $this->mResultSet === false ) {
+ if ( $this->resultSet === false ) {
return false;
}
- $this->mResultSet->free();
+ $this->resultSet->free();
+ }
+
+ function getTotalHits() {
+ return $this->totalHits;
}
}
* Perform a full text search query and return a result set.
*
* @param string $term Raw search term
- * @return SqliteSearchResultSet
+ * @return SqlSearchResultSet
*/
function searchText( $term ) {
return $this->searchInternal( $term, true );
* Perform a title-only search query and return a result set.
*
* @param string $term Raw search term
- * @return SqliteSearchResultSet
+ * @return SqlSearchResultSet
*/
function searchTitle( $term ) {
return $this->searchInternal( $term, false );
$totalResult->free();
}
- return new SqliteSearchResultSet( $resultSet, $this->searchTerms, $total );
+ return new SqlSearchResultSet( $resultSet, $this->searchTerms, $total );
}
/**
__METHOD__ );
}
}
-
-/**
- * @ingroup Search
- */
-class SqliteSearchResultSet extends SqlSearchResultSet {
- function __construct( $resultSet, $terms, $totalHits = null ) {
- parent::__construct( $resultSet, $terms );
- $this->mTotalHits = $totalHits;
- }
-
- function getTotalHits() {
- return $this->mTotalHits;
- }
-}