* Fixed unclosed <p> tag
[lhc/web/wiklou.git] / includes / DatabaseFunctions.php
index dadc751..772ca43 100644 (file)
@@ -4,7 +4,6 @@
  * 
  * Note: $wgDatabase has ceased to exist. Destroy all references.
  *
- * @version # $Id$
  * @package MediaWiki
  */
 
@@ -48,29 +47,11 @@ function wfSingleQuery( $sql, $dbi, $fname = '' ) {
 /*
  * @todo document function
  */
-function &wfGetDB( $db = DB_LAST ) {
+function &wfGetDB( $db = DB_LAST, $groups = array() ) {
        global $wgLoadBalancer;
-       return $wgLoadBalancer->getConnection( $db );
+       return $wgLoadBalancer->getConnection( $db, true, $groups );
 }
        
-/**
- * Turns buffering of SQL result
- * Sets on (true) or off (false). Default is "on" and it should not be changed
- * without good reasons.
- *
- * @param $newstate
- * @param $dbi
- * @return mixed|NULL Returns the previous state.
-*/
-function wfBufferSQLResults( $newstate, $dbi = DB_LAST ) {
-       $db =& wfGetDB( $dbi );
-       if ( $db !== false ) {
-               return $db->setBufferResults( $newstate );
-       } else {
-               return NULL;
-       }
-}
-
 /**
  * Turns on (false) or off (true) the automatic generation and sending
  * of a "we're sorry, but there has been a database error" page on
@@ -272,7 +253,7 @@ function wfGetSQL( $table, $var, $cond='', $dbi = DB_LAST )
 {
        $db =& wfGetDB( $dbi );
        if ( $db !== false ) {
-               return $db->getField( $table, $var, $cond );
+               return $db->selectField( $table, $var, $cond );
        } else {        
                return false;
        }
@@ -308,7 +289,7 @@ function wfIndexExists( $table, $index, $dbi = DB_LAST ) {
 function wfInsertArray( $table, $array, $fname = 'wfInsertArray', $dbi = DB_MASTER ) {
        $db =& wfGetDB( $dbi );
        if ( $db !== false ) {
-               return $db->insertArray( $table, $array, $fname );
+               return $db->insert( $table, $array, $fname );
        } else {        
                return false;
        }
@@ -332,7 +313,7 @@ function wfGetArray( $table, $vars, $conds, $fname = 'wfGetArray', $dbi = DB_LAS
 function wfUpdateArray( $table, $values, $conds, $fname = 'wfUpdateArray', $dbi = DB_MASTER ) {
        $db =& wfGetDB( $dbi );
        if ( $db !== false ) {
-               $db->updateArray( $table, $values, $conds, $fname );
+               $db->update( $table, $values, $conds, $fname );
                return true;
        } else {
                return false;