db_version example


    $iqueries = apply_filters( 'dbdelta_insert_queries', $iqueries );

    $text_fields = array( 'tinytext', 'text', 'mediumtext', 'longtext' );
    $blob_fields = array( 'tinyblob', 'blob', 'mediumblob', 'longblob' );
    $int_fields  = array( 'tinyint', 'smallint', 'mediumint', 'int', 'integer', 'bigint' );

    $global_tables  = $wpdb->tables( 'global' );
    $db_version     = $wpdb->db_version();
    $db_server_info = $wpdb->db_server_info();

    foreach ( $cqueries as $table => $qry ) {
        // Upgrade global tables only for the main site. Don't upgrade at all if conditions are not optimal.         if ( in_array( $table$global_tables, true ) && ! wp_should_upgrade_global_tables() ) {
            unset( $cqueries[ $table ]$for_update[ $table ] );
            continue;
        }

        // Fetch the table column structure from the database.         $suppress    = $wpdb->suppress_errors();
        
return false;
        }

        // If it's a core update, are we actually compatible with its requirements?         if ( 'core' === $type ) {
            global $wpdb;

            $php_compat = version_compare( PHP_VERSION, $item->php_version, '>=' );
            if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
                $mysql_compat = true;
            } else {
                $mysql_compat = version_compare( $wpdb->db_version()$item->mysql_version, '>=' );
            }

            if ( ! $php_compat || ! $mysql_compat ) {
                return false;
            }
        }

        // If updating a plugin or theme, ensure the minimum PHP version requirements are satisfied.         if ( in_array( $type, array( 'plugin', 'theme' ), true ) ) {
            if ( ! empty( $item->requires_php ) && version_compare( PHP_VERSION, $item->requires_php, '<' ) ) {
                return false;
            }
$version_string = sprintf( '%s&ndash;%s', $update->current, $update->locale );
    }

    $current = false;
    if ( ! isset( $update->response ) || 'latest' === $update->response ) {
        $current = true;
    }

    $message       = '';
    $form_action   = 'update-core.php?action=do-core-upgrade';
    $php_version   = PHP_VERSION;
    $mysql_version = $wpdb->db_version();
    $show_buttons  = true;

    // Nightly build versions have two hyphens and a commit number.     if ( preg_match( '/-\w+-\d+/', $update->current ) ) {
        // Retrieve the major version number.         preg_match( '/^\d+.\d+/', $update->current, $update_major );
        /* translators: %s: WordPress version. */
        $submit = sprintf( __( 'Update to latest %s nightly' )$update_major[0] );
    } else {
        /* translators: %s: WordPress version. */
        $submit = sprintf( __( 'Update to version %s' )$version_string );
    }

    public function check_database_version() {
        global $wp_version$required_mysql_version;
        // Make sure the server has the required MySQL version.         if ( version_compare( $this->db_version()$required_mysql_version, '<' ) ) {
            /* translators: 1: WordPress version number, 2: Minimum required MySQL version number. */
            return new WP_Error( 'database_version', sprintf( __( '<strong>Error:</strong> WordPress %1$s requires MySQL %2$s or higher' )$wp_version$required_mysql_version ) );
        }
    }

    /** * Determines whether the database supports collation. * * Called when WordPress is generating the table scheme. * * Use `wpdb::has_cap( 'collation' )`. * * @since 2.5.0 * @deprecated 3.5.0 Use wpdb::has_cap() * * @return bool True if collation is supported, false if not. */


/** * @global string $wp_version The WordPress version string. * @global string $required_php_version The required PHP version string. * @global string $required_mysql_version The required MySQL version string. * @global wpdb $wpdb WordPress database abstraction object. */
global $wp_version$required_php_version$required_mysql_version$wpdb;

$php_version   = PHP_VERSION;
$mysql_version = $wpdb->db_version();
$php_compat    = version_compare( $php_version$required_php_version, '>=' );
$mysql_compat  = version_compare( $mysql_version$required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );

$version_url = sprintf(
    /* translators: %s: WordPress version. */
    esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
    sanitize_title( $wp_version )
);

$php_update_message = '</p><p>' . sprintf(
    /* translators: %s: URL to Update PHP page. */
    
/** * @global string $wp_version The WordPress version string. * @global string $required_php_version The required PHP version string. * @global string $required_mysql_version The required MySQL version string. * @global wpdb $wpdb WordPress database abstraction object. */
global $wp_version$required_php_version$required_mysql_version$wpdb;

$step = (int) $step;

$php_version   = PHP_VERSION;
$mysql_version = $wpdb->db_version();
$php_compat    = version_compare( $php_version$required_php_version, '>=' );
if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
    $mysql_compat = true;
} else {
    $mysql_compat = version_compare( $mysql_version$required_mysql_version, '>=' );
}

header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
?> <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta name="viewport" content="width=device-width" /> <meta http-equiv="Content-Type" content="

    if ( function_exists( 'wp_opcache_invalidate' ) ) {
        wp_opcache_invalidate( $versions_file );
    }

    require WP_CONTENT_DIR . '/upgrade/version-current.php';
    $wp_filesystem->delete( $versions_file );

    $php_version    = PHP_VERSION;
    $mysql_version  = $wpdb->db_version();
    $old_wp_version = $GLOBALS['wp_version']; // The version of WordPress we're updating from.     /* * Note: str_contains() is not used here, as this file is included * when updating from older WordPress versions, in which case * the polyfills from wp-includes/compat.php may not be available. */
    $development_build = ( false !== strpos( $old_wp_version . $wp_version, '-' ) ); // A dash in the version indicates a development release.     $php_compat        = version_compare( $php_version$required_php_version, '>=' );

    if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
        $mysql_compat = true;
    }

    $locale = apply_filters( 'core_version_check_locale', get_locale() );

    // Update last_checked for current to prevent multiple blocking requests if request hangs.     $current->last_checked = time();
    set_site_transient( 'update_core', $current );

    if ( method_exists( $wpdb, 'db_server_info' ) ) {
        $mysql_version = $wpdb->db_server_info();
    } elseif ( method_exists( $wpdb, 'db_version' ) ) {
        $mysql_version = preg_replace( '/[^0-9.].*/', '', $wpdb->db_version() );
    } else {
        $mysql_version = 'N/A';
    }

    if ( is_multisite() ) {
        $num_blogs         = get_blog_count();
        $wp_install        = network_site_url();
        $multisite_enabled = 1;
    } else {
        $multisite_enabled = 0;
        $num_blogs         = 1;
        
Home | Imprint | This part of the site doesn't use cookies.