Skip to content

Commit a9287b5

Browse files
committed
Rename DATABASE_TYPE to DB_ENGINE for consistency with other constants
1 parent 4e67ce0 commit a9287b5

8 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎src/wp-admin/includes/class-wp-debug-data.php‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ public static function debug_data() {
278278
'label' => 'WP_MAX_MEMORY_LIMIT',
279279
'value' => WP_MAX_MEMORY_LIMIT,
280280
),
281-
'DATABASE_TYPE' => array(
282-
'label' => 'DATABASE_TYPE',
283-
'value' => ( defined( 'DATABASE_TYPE' ) ? DATABASE_TYPE : __( 'Undefined' ) ),
284-
'debug' => ( defined( 'DATABASE_TYPE' ) ? DATABASE_TYPE : 'undefined' ),
281+
'DB_ENGINE' => array(
282+
'label' => 'DB_ENGINE',
283+
'value' => ( defined( 'DB_ENGINE' ) ? DB_ENGINE : __( 'Undefined' ) ),
284+
'debug' => ( defined( 'DB_ENGINE' ) ? DB_ENGINE : 'undefined' ),
285285
),
286286
'WP_DEBUG' => array(
287287
'label' => 'WP_DEBUG',
@@ -864,10 +864,10 @@ public static function debug_data() {
864864
'value' => wp_date( 'c', $_SERVER['REQUEST_TIME'] ),
865865
);
866866

867-
$database_type = defined( 'DATABASE_TYPE' ) && 'sqlite' === DATABASE_TYPE ? 'sqlite' : 'mysql';
867+
$db_engine = defined( 'DB_ENGINE' ) && 'sqlite' === DB_ENGINE ? 'sqlite' : 'mysql';
868868

869869
$extension = null;
870-
if ( 'mysql' === $database_type ) {
870+
if ( 'mysql' === $db_engine ) {
871871
// Populate the database debug fields.
872872
if ( is_resource( $wpdb->dbh ) ) {
873873
// Old mysql extension.
@@ -891,12 +891,12 @@ public static function debug_data() {
891891
}
892892
}
893893

894-
$info['wp-database']['fields']['database_type'] = array(
895-
'label' => __( 'Database type' ),
896-
'value' => 'sqlite' === $database_type ? 'SQLite' : 'MySQL/MariaDB',
894+
$info['wp-database']['fields']['db_engine'] = array(
895+
'label' => __( 'Database engine' ),
896+
'value' => 'sqlite' === $db_engine ? 'SQLite' : 'MySQL/MariaDB',
897897
);
898898

899-
if ( 'mysql' === $database_type ) {
899+
if ( 'mysql' === $db_engine ) {
900900
$info['wp-database']['fields']['extension'] = array(
901901
'label' => __( 'Extension' ),
902902
'value' => $extension,
@@ -929,7 +929,7 @@ public static function debug_data() {
929929
'value' => $wpdb->dbname,
930930
'private' => true,
931931
);
932-
} elseif ( 'sqlite' === $database_type ) {
932+
} elseif ( 'sqlite' === $db_engine ) {
933933
$info['wp-database']['fields']['database_version'] = array(
934934
'label' => __( 'SQLite version' ),
935935
'value' => class_exists( 'SQLite3' ) ? SQLite3::version()['versionString'] : null,
@@ -953,7 +953,7 @@ public static function debug_data() {
953953
'private' => true,
954954
);
955955

956-
if ( 'mysql' === $database_type ) {
956+
if ( 'mysql' === $db_engine ) {
957957
$info['wp-database']['fields']['database_charset'] = array(
958958
'label' => __( 'Database charset' ),
959959
'value' => $wpdb->charset,

‎src/wp-admin/includes/class-wp-site-health.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private function prepare_sql_data() {
209209
global $wpdb;
210210

211211
$mysql_server_type = $wpdb->db_server_info();
212-
$this->is_sqlite = defined( 'DATABASE_TYPE' ) && 'sqlite' === DATABASE_TYPE ? 'sqlite' : 'mysql';
212+
$this->is_sqlite = defined( 'DB_ENGINE' ) && 'sqlite' === DB_ENGINE ? 'sqlite' : 'mysql';
213213

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

‎src/wp-admin/includes/upgrade.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function wp_install( $blog_title, $user_name, $user_email, $is_public, $deprecat
5252
wp_check_mysql_version();
5353
wp_cache_flush();
5454

55-
if ( defined( 'DATABASE_TYPE' ) && 'sqlite' === DATABASE_TYPE ) {
55+
if ( defined( 'DB_ENGINE' ) && 'sqlite' === DB_ENGINE ) {
5656
sqlite_make_db_sqlite(); // phpcs:ignore PHPCompatibility.Extensions.RemovedExtensions.sqliteRemoved
5757
} else {
5858
make_db_current_silent();

‎src/wp-admin/setup-config.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function setup_config_display_header( $body_classes = array() ) {
352352
*
353353
* @ignore
354354
*/
355-
define( 'DATABASE_TYPE', $dbtype );
355+
define( 'DB_ENGINE', $dbtype );
356356
define( 'DB_NAME', $dbname );
357357
define( 'DB_USER', $uname );
358358
define( 'DB_PASSWORD', $pwd );
@@ -363,7 +363,7 @@ function setup_config_display_header( $body_classes = array() ) {
363363
*
364364
* @ignore
365365
*/
366-
define( 'DATABASE_TYPE', $dbtype );
366+
define( 'DB_ENGINE', $dbtype );
367367
define( 'DB_NAME', '' );
368368
define( 'DB_USER', '' );
369369
define( 'DB_PASSWORD', '' );
@@ -442,7 +442,7 @@ function setup_config_display_header( $body_classes = array() ) {
442442
$padding = $match[2];
443443

444444
switch ( $constant ) {
445-
case 'DATABASE_TYPE':
445+
case 'DB_ENGINE':
446446
case 'DB_NAME':
447447
case 'DB_USER':
448448
case 'DB_PASSWORD':

‎src/wp-includes/load.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ function require_wp_db() {
662662

663663
require_once ABSPATH . WPINC . '/class-wpdb.php';
664664

665-
if ( defined( 'DATABASE_TYPE' ) && 'sqlite' === DATABASE_TYPE ) {
665+
if ( defined( 'DB_ENGINE' ) && 'sqlite' === DB_ENGINE ) {
666666
require_once ABSPATH . WPINC . '/sqlite/db.php';
667667
}
668668

‎src/wp-includes/sqlite/db.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* @since 1.0.0
77
*/
88

9-
// Bail early if DATABASE_TYPE is not defined as sqlite.
10-
if ( ! defined( 'DATABASE_TYPE' ) || 'sqlite' !== DATABASE_TYPE ) {
9+
// Bail early if DB_ENGINE is not defined as sqlite.
10+
if ( ! defined( 'DB_ENGINE' ) || 'sqlite' !== DB_ENGINE ) {
1111
return;
1212
}
1313

‎src/wp-load.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323

2424
// @TODO: Remove this. It's only here so that the PR can be tested.
25-
define( 'DATABASE_TYPE', 'sqlite' );
25+
define( 'DB_ENGINE', 'sqlite' );
2626

2727
/*
2828
* The error_reporting() function can be disabled in php.ini. On systems where that is the case,

‎wp-config-sample.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
// ** Database settings - You can get this info from your web host ** //
22-
define( 'DATABASE_TYPE', 'mysql' );
22+
define( 'DB_ENGINE', 'mysql' );
2323

2424
/** The name of the database for WordPress */
2525
define( 'DB_NAME', 'database_name_here' );

0 commit comments

Comments
 (0)