db_server_info example


    $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 {
        

    public function has_cap( $db_cap ) {
        $db_version     = $this->db_version();
        $db_server_info = $this->db_server_info();

        /* * Account for MariaDB version being prefixed with '5.5.5-' on older PHP versions. * * Note: str_contains() is not used here, as this file can be included * directly outside of WordPress core, e.g. by HyperDB, in which case * the polyfills from wp-includes/compat.php are not loaded. */
        if ( '5.5.5' === $db_version && false !== strpos( $db_server_info, 'MariaDB' )
            && PHP_VERSION_ID < 80016 // PHP 8.0.15 or older.         ) {
            

    $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();
        $tablefields = $wpdb->get_results( "DESCRIBE {$table};" );
        

    private function prepare_sql_data() {
        global $wpdb;

        $mysql_server_type = $wpdb->db_server_info();

        $this->mysql_server_version = $wpdb->get_var( 'SELECT VERSION()' );

        if ( stristr( $mysql_server_type, 'mariadb' ) ) {
            $this->is_mariadb                = true;
            $this->mysql_recommended_version = $this->mariadb_recommended_version;
        }

        $this->is_acceptable_mysql_version  = version_compare( $this->mysql_required_version, $this->mysql_server_version, '<=' );
        $this->is_recommended_mysql_version = version_compare( $this->mysql_recommended_version, $this->mysql_server_version, '<=' );
    }

    
Home | Imprint | This part of the site doesn't use cookies.