var $namespaces = array( NS_MAIN );
var $showRedirects = false;
+ function __construct($db = null) {
+ if ( $db ) {
+ $this->db = $db;
+ } else {
+ $this->db = wfGetDB( DB_SLAVE );
+ }
+ }
+
/**
* Perform a full text search query and return a result set.
* If title searches are not supported or disabled, return null.
public static function getNearMatch( $searchterm ) {
$title = self::getNearMatchInternal( $searchterm );
+ wfRunHooks( 'SpecialSearchGomatch', array( &$title ) );
+
wfRunHooks( 'SearchGetNearMatchComplete', array( $searchterm, &$title ) );
return $title;
}
$allSearchTerms = array_merge( $allSearchTerms, $wgContLang->autoConvertToAllVariants( $searchterm ) );
}
+ $titleResult = null;
if ( !wfRunHooks( 'SearchGetNearMatchBefore', array( $allSearchTerms, &$titleResult ) ) ) {
return $titleResult;
}
*/
public static function create() {
global $wgSearchType;
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = null;
if ( $wgSearchType ) {
$class = $wgSearchType;
} else {
+ $dbr = wfGetDB( DB_SLAVE );
$class = $dbr->getSearchEngine();
}
$search = new $class( $dbr );
class SearchHighlighter {
var $mCleanWikitext = true;
- function SearchHighlighter( $cleanupWikitext = true ) {
+ function __construct( $cleanupWikitext = true ) {
$this->mCleanWikitext = $cleanupWikitext;
}