dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c61af99
)
Add a Database::getType() function so that we can get rid of $wgDBtype in favour...
author
Tim Starling
<tstarling@users.mediawiki.org>
Thu, 7 Jan 2010 00:22:18 +0000
(
00:22
+0000)
committer
Tim Starling
<tstarling@users.mediawiki.org>
Thu, 7 Jan 2010 00:22:18 +0000
(
00:22
+0000)
includes/db/Database.php
patch
|
blob
|
history
diff --git
a/includes/db/Database.php
b/includes/db/Database.php
index
059fa7c
..
ef1abfc
100644
(file)
--- a/
includes/db/Database.php
+++ b/
includes/db/Database.php
@@
-284,6
+284,17
@@
abstract class DatabaseBase {
}
}
+ /**
+ * 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.' );
+ }
+ }
+
#------------------------------------------------------------------------------
# Other functions
#------------------------------------------------------------------------------