/**
* Get the type of the DBMS, as it appears in $wgDBtype.
*/
- function getType() {
- if ( preg_match( '/^Database(\w+)$/', get_class( $this ), $m ) ) {
- return strtolower( $m[1] );
- } else {
- throw new MWException( get_class( $this ) .'::getType: unable to determine type.' );
- }
- }
+ abstract function getType();
#------------------------------------------------------------------------------
# Other functions
return $this->mDBname;
}
}
-
+
+ function getType() {
+ return 'ibm_db2';
+ }
######################################
# Setup
}
+ function getType() {
+ return 'mssql';
+ }
+
/**
* todo: check if these should be true like parent class
*/
* @see Database
*/
class DatabaseMysql extends DatabaseBase {
+ function getType() {
+ return 'mysql';
+ }
+
/*private*/ function doQuery( $sql ) {
if( $this->bufferResults() ) {
$ret = mysql_query( $sql, $this->mConn );
wfRunHooks( 'DatabaseOraclePostInit', array( &$this ) );
}
+ function getType() {
+ return 'oracle';
+ }
+
function cascadingDeletes() {
return true;
}
}
+ function getType() {
+ return 'postgres';
+ }
+
function cascadingDeletes() {
return true;
}
$this->open( $server, $user, $password, $dbName );
}
+ function getType() {
+ return 'sqlite';
+ }
+
/**
* @todo: check if it should be true like parent class
*/