Fixes the r76809 issue of SearchDbTest not being marked as requiring a Database.
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 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 );
* @ingroup Search
*/
class SearchIBM_DB2 extends SearchEngine {
+
+ /**
+ * Creates an instance of this class
+ * @param $db DatabaseIbm_db2: database object
+ */
function __construct($db) {
- $this->db = $db;
+ parent::__construct( $db );
}
/**
*/
class SearchMssql extends SearchEngine {
+ /**
+ * Creates an instance of this class
+ * @param $db DatabaseMssql: database object
+ */
function __construct( $db ) {
- $this->db = $db;
+ parent::__construct( $db );
}
/**
var $strictMatching = true;
static $mMinSearchLength;
- /** @todo document */
+ /**
+ * Creates an instance of this class
+ * @param $db DatabaseMysql: database object
+ */
function __construct( $db ) {
- $this->db = $db;
+ parent::__construct( $db );
}
/**
function getTotalHits() {
return $this->mTotalHits;
}
-}
\ No newline at end of file
+}
'TRSYN' => 1,
'TT' => 1,
'WITHIN' => 1);
-
+
+ /**
+ * Creates an instance of this class
+ * @param $db DatabasePostgres: database object
+ */
function __construct($db) {
- $this->db = $db;
+ parent::__construct( $db );
}
/**
* @ingroup Search
*/
class SearchPostgres extends SearchEngine {
-
+ /**
+ * Creates an instance of this class
+ * @param $db DatabaseSqlite: database object
+ */
function __construct( $db ) {
- $this->db = $db;
+ parent::__construct( $db );
}
/**
* @param $db DatabaseSqlite: database object
*/
function __construct( $db ) {
- $this->db = $db;
+ parent::__construct( $db );
}
/**
function getTotalHits() {
return $this->mTotalHits;
}
-}
\ No newline at end of file
+}