Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -284,6 +284,17 @@ |
285 | 285 | } |
286 | 286 | } |
287 | 287 | |
| 288 | + /** |
| 289 | + * Get the type of the DBMS, as it appears in $wgDBtype. |
| 290 | + */ |
| 291 | + function getType() { |
| 292 | + if ( preg_match( '/^Database(\w+)$/', get_class( $this ), $m ) ) { |
| 293 | + return strtolower( $m[1] ); |
| 294 | + } else { |
| 295 | + throw new MWException( get_class( $this ) .'::getType: unable to determine type.' ); |
| 296 | + } |
| 297 | + } |
| 298 | + |
288 | 299 | #------------------------------------------------------------------------------ |
289 | 300 | # Other functions |
290 | 301 | #------------------------------------------------------------------------------ |