<?php
function install_version_checks() {
- # Turn off output buffering if it's on
- @ob_end_flush();
+ # We dare not turn output buffer _off_ since this will break completely
+ # if PHP is globally configured to run through a gzip filter.
+ @ob_implicit_flush( true );
if( !function_exists( "version_compare" ) ) {
# version_compare was introduced in 4.1.0
# Obsolete, use Database::fieldExists()
function field_exists( $table, $field ) {
$fname = "Update script: field_exists";
- $db =& wfGetDB( DB_READ );
+ $db =& wfGetDB( DB_SLAVE );
$res = $db->query( "DESCRIBE $table", $fname );
$found = false;
- while ( $row = wfFetchObject( $res ) ) {
+ while ( $row = $db->fetchObject( $res ) ) {
if ( $row->Field == $field ) {
$found = true;
break;