Skip to content

Commit 632a634

Browse files
committed
Docs: Documentation and i18n string improvements relating to MySQL and server requirements.
See #63166 git-svn-id: https://develop.svn.wordpress.org/trunk@60363 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a7e3e02 commit 632a634

6 files changed

Lines changed: 35 additions & 26 deletions

File tree

src/wp-admin/install.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,9 @@ function display_setup_form( $error = null ) {
233233

234234
/**
235235
* @global string $wp_version The WordPress version string.
236-
* @global string $required_php_version The required PHP version string.
236+
* @global string $required_php_version The minimum required PHP version string.
237237
* @global string[] $required_php_extensions The names of required PHP extensions.
238-
* @global string $required_mysql_version The required MySQL version string.
238+
* @global string $required_mysql_version The minimum required MySQL version string.
239239
* @global wpdb $wpdb WordPress database abstraction object.
240240
*/
241241
global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb;

src/wp-admin/upgrade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838
/**
3939
* @global string $wp_version The WordPress version string.
40-
* @global string $required_php_version The required PHP version string.
40+
* @global string $required_php_version The minimum required PHP version string.
4141
* @global string[] $required_php_extensions The names of required PHP extensions.
42-
* @global string $required_mysql_version The required MySQL version string.
42+
* @global string $required_mysql_version The minimum required MySQL version string.
4343
* @global wpdb $wpdb WordPress database abstraction object.
4444
*/
4545
global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb;

src/wp-includes/class-wpdb.php

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* By default, WordPress uses this class to instantiate the global $wpdb object, providing
4444
* access to the WordPress database.
4545
*
46-
* It is possible to replace this class with your own by setting the $wpdb global variable
46+
* It is possible to replace the global instance with your own by setting the $wpdb global variable
4747
* in wp-content/db.php file to your class. The wpdb class will still be included, so you can
4848
* extend it or simply use your own.
4949
*
@@ -237,7 +237,6 @@ class wpdb {
237237
* WordPress table prefix.
238238
*
239239
* You can set this to have multiple WordPress installations in a single database.
240-
* The second reason is for possible security precautions.
241240
*
242241
* @since 2.5.0
243242
*
@@ -941,7 +940,7 @@ public function set_charset( $dbh, $charset = null, $collate = null ) {
941940
/**
942941
* Changes the current SQL mode, and ensures its WordPress compatibility.
943942
*
944-
* If no modes are passed, it will ensure the current MySQL server modes are compatible.
943+
* If no modes are passed, it will ensure the current SQL server modes are compatible.
945944
*
946945
* @since 3.9.0
947946
*
@@ -1369,7 +1368,7 @@ public function escape_by_ref( &$data ) {
13691368
}
13701369

13711370
/**
1372-
* Quotes an identifier for a MySQL database, e.g. table/field names.
1371+
* Quotes an identifier such as a table or field name.
13731372
*
13741373
* @since 6.2.0
13751374
*
@@ -1435,6 +1434,13 @@ private function _escape_identifier_value( $identifier ) {
14351434
* 'foo'
14361435
* );
14371436
*
1437+
* $wpdb->prepare(
1438+
* "SELECT * FROM %i WHERE %i = %s",
1439+
* $table,
1440+
* $field,
1441+
* $value
1442+
* );
1443+
*
14381444
* @since 2.3.0
14391445
* @since 5.3.0 Formalized the existing and already documented `...$args` parameter
14401446
* by updating the function signature. The second parameter was changed
@@ -1957,7 +1963,7 @@ public function db_connect( $allow_bail = true ) {
19571963
$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;
19581964

19591965
/*
1960-
* Set the MySQLi error reporting off because WordPress handles its own.
1966+
* Switch error reporting off because WordPress handles its own.
19611967
* This is due to the default value change from `MYSQLI_REPORT_OFF`
19621968
* to `MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT` in PHP 8.1.
19631969
*/
@@ -2100,7 +2106,7 @@ public function parse_db_host( $host ) {
21002106
}
21012107

21022108
$host = ! empty( $matches['host'] ) ? $matches['host'] : '';
2103-
// MySQLi port cannot be a string; must be null or an integer.
2109+
// Port cannot be a string; must be null or an integer.
21042110
$port = ! empty( $matches['port'] ) ? absint( $matches['port'] ) : null;
21052111

21062112
return array( $host, $port, $socket, $is_ipv6 );
@@ -2290,7 +2296,7 @@ public function query( $query ) {
22902296
if ( $this->dbh instanceof mysqli ) {
22912297
$this->last_error = mysqli_error( $this->dbh );
22922298
} else {
2293-
$this->last_error = __( 'Unable to retrieve the error message from MySQL' );
2299+
$this->last_error = __( 'Unable to retrieve the error message from the database server' );
22942300
}
22952301

22962302
if ( $this->last_error ) {
@@ -3473,7 +3479,7 @@ protected function check_ascii( $input_string ) {
34733479
}
34743480

34753481
/**
3476-
* Checks if the query is accessing a collation considered safe on the current version of MySQL.
3482+
* Checks if the query is accessing a collation considered safe.
34773483
*
34783484
* @since 4.2.0
34793485
*
@@ -3987,11 +3993,11 @@ public function close() {
39873993
}
39883994

39893995
/**
3990-
* Determines whether MySQL database is at least the required minimum version.
3996+
* Determines whether the database server is at least the required minimum version.
39913997
*
39923998
* @since 2.5.0
39933999
*
3994-
* @global string $required_mysql_version The required MySQL version string.
4000+
* @global string $required_mysql_version The minimum required MySQL version string.
39954001
* @return void|WP_Error
39964002
*/
39974003
public function check_database_version() {
@@ -4047,7 +4053,7 @@ public function get_charset_collate() {
40474053
*
40484054
* Capability sniffs for the database server and current version of WPDB.
40494055
*
4050-
* Database sniffs are based on the version of MySQL the site is using.
4056+
* Database sniffs are based on the version of the database server in use.
40514057
*
40524058
* WPDB sniffs are added as new features are introduced to allow theme and plugin
40534059
* developers to determine feature support. This is to account for drop-ins which may
@@ -4119,7 +4125,7 @@ public function get_caller() {
41194125
}
41204126

41214127
/**
4122-
* Retrieves the database server version.
4128+
* Retrieves the database server version number.
41234129
*
41244130
* @since 2.7.0
41254131
*
@@ -4130,11 +4136,11 @@ public function db_version() {
41304136
}
41314137

41324138
/**
4133-
* Returns the version of the MySQL server.
4139+
* Returns the raw version string of the database server.
41344140
*
41354141
* @since 5.5.0
41364142
*
4137-
* @return string Server version as a string.
4143+
* @return string Database server version as a string.
41384144
*/
41394145
public function db_server_info() {
41404146
return mysqli_get_server_info( $this->dbh );

src/wp-includes/load.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,18 @@ function wp_populate_basic_auth_from_authorization_header() {
139139
}
140140

141141
/**
142-
* Checks for the required PHP version, and the mysqli extension or
143-
* a database drop-in.
142+
* Checks the server requirements.
143+
*
144+
* - PHP version
145+
* - PHP extensions
146+
* - MySQL or MariaDB version (unless a database drop-in is present)
144147
*
145148
* Dies if requirements are not met.
146149
*
147150
* @since 3.0.0
148151
* @access private
149152
*
150-
* @global string $required_php_version The required PHP version string.
153+
* @global string $required_php_version The minimum required PHP version string.
151154
* @global string[] $required_php_extensions The names of required PHP extensions.
152155
* @global string $wp_version The WordPress version string.
153156
*/

src/wp-includes/version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
$tinymce_version = '49110-20201110';
3434

3535
/**
36-
* Holds the required PHP version.
36+
* Holds the minimum required PHP version.
3737
*
3838
* @global string $required_php_version
3939
*/
@@ -50,7 +50,7 @@
5050
);
5151

5252
/**
53-
* Holds the required MySQL version.
53+
* Holds the minimum required MySQL version.
5454
*
5555
* @global string $required_mysql_version
5656
*/

src/wp-settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
* @global string $wp_version The WordPress version string.
2626
* @global int $wp_db_version WordPress database version.
2727
* @global string $tinymce_version TinyMCE version.
28-
* @global string $required_php_version The required PHP version string.
28+
* @global string $required_php_version The minimum required PHP version string.
2929
* @global string[] $required_php_extensions The names of required PHP extensions.
30-
* @global string $required_mysql_version The required MySQL version string.
30+
* @global string $required_mysql_version The minimum required MySQL version string.
3131
* @global string $wp_local_package Locale code of the package.
3232
*/
3333
global $wp_version, $wp_db_version, $tinymce_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wp_local_package;
3434
require ABSPATH . WPINC . '/version.php';
3535
require ABSPATH . WPINC . '/compat.php';
3636
require ABSPATH . WPINC . '/load.php';
3737

38-
// Check for the required PHP version and for the MySQL extension or a database drop-in.
38+
// Check the server requirements.
3939
wp_check_php_mysql_versions();
4040

4141
// Include files required for initialization.

0 commit comments

Comments
 (0)