Use ob_implicit_flush() rather than ob_end_flush() in install-utils.
[lhc/web/wiklou.git] / install-utils.inc
index 2ee841f..1fb2cc8 100644 (file)
@@ -1,8 +1,9 @@
 <?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
@@ -132,11 +133,11 @@ function dbsource( $fname, $database = false ) {
 # 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;