WP_Site_Health::prepare_sql_data()privateWP 5.2.0

Runs the SQL version checks.

These values are used in later tests, but the part of preparing them is more easily managed early in the class for ease of access and discovery.

{} Это метод класса: WP_Site_Health{}

Хуков нет.

Возвращает

null. Ничего.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->prepare_sql_data();

Заметки

  • Global. wpdb. $wpdb WordPress database abstraction object.

Список изменений

С версии 5.2.0 Введена.

Код WP_Site_Health::prepare_sql_data() WP 6.1.1

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, '<=' );
}