X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fdb%2FDatabaseMysql.php;h=fab0e96ee531b9bdb374974a03833536317b6fa7;hb=586e8fb7ec09321df726229964e8784444013fa9;hp=04c22f12df3d91419e9a900a41c1c3bbb54e6e45;hpb=d5294eef8ac731450ca1cba0decd582f11fbd98b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 04c22f12df..fab0e96ee5 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -193,7 +193,7 @@ class DatabaseMysql extends DatabaseBase { /** * @param $res ResultWrapper - * @return object|stdClass + * @return object|bool * @throws DBUnexpectedError */ function fetchObject( $res ) { @@ -217,7 +217,7 @@ class DatabaseMysql extends DatabaseBase { /** * @param $res ResultWrapper - * @return array + * @return array|bool * @throws DBUnexpectedError */ function fetchRow( $res ) { @@ -361,7 +361,7 @@ class DatabaseMysql extends DatabaseBase { * @param $options string|array * @return int */ - public function estimateRowCount( $table, $vars='*', $conds='', $fname = 'DatabaseMysql::estimateRowCount', $options = array() ) { + public function estimateRowCount( $table, $vars = '*', $conds = '', $fname = 'DatabaseMysql::estimateRowCount', $options = array() ) { $options['EXPLAIN'] = true; $res = $this->select( $table, $vars, $conds, $fname, $options ); if ( $res === false ) { @@ -393,7 +393,7 @@ class DatabaseMysql extends DatabaseBase { for( $i = 0; $i < $n; $i++ ) { $meta = mysql_fetch_field( $res->result, $i ); if( $field == $meta->name ) { - return new MySQLField($meta); + return new MySQLField( $meta ); } } return false; @@ -449,7 +449,7 @@ class DatabaseMysql extends DatabaseBase { function strencode( $s ) { $sQuoted = mysql_real_escape_string( $s, $this->mConn ); - if($sQuoted === false) { + if( $sQuoted === false ) { $this->ping(); $sQuoted = mysql_real_escape_string( $s, $this->mConn ); } @@ -685,7 +685,7 @@ class DatabaseMysql extends DatabaseBase { public function streamStatementEnd( &$sql, &$newLine ) { if ( strtoupper( substr( $newLine, 0, 9 ) ) == 'DELIMITER' ) { - preg_match( '/^DELIMITER\s+(\S+)/' , $newLine, $m ); + preg_match( '/^DELIMITER\s+(\S+)/', $newLine, $m ); $this->delimiter = $m[1]; $newLine = ''; } @@ -721,7 +721,7 @@ class DatabaseMysql extends DatabaseBase { if( $row->lockstatus == 1 ) { return true; } else { - wfDebug( __METHOD__." failed to acquire lock\n" ); + wfDebug( __METHOD__ . " failed to acquire lock\n" ); return false; } } @@ -744,6 +744,7 @@ class DatabaseMysql extends DatabaseBase { * @param $write array * @param $method string * @param $lowPriority bool + * @return bool */ public function lockTables( $read, $write, $method, $lowPriority = true ) { $items = array(); @@ -759,13 +760,16 @@ class DatabaseMysql extends DatabaseBase { } $sql = "LOCK TABLES " . implode( ',', $items ); $this->query( $sql, $method ); + return true; } /** * @param $method string + * @return bool */ public function unlockTables( $method ) { $this->query( "UNLOCK TABLES", $method ); + return true; } /** @@ -899,7 +903,7 @@ class DatabaseMysql extends DatabaseBase { $endArray = array(); foreach( $result as $table ) { - $vars = get_object_vars($table); + $vars = get_object_vars( $table ); $table = array_pop( $vars ); if( !$prefix || strpos( $table, $prefix ) === 0 ) {