Skip to content

Commit 39c1e6a

Browse files
committed
Remove DB_NAME fallback for the legacy driver
The filter-based fallback to 'database_name_here' was added to ease early adoption of the new AST-based driver in projects that didn't define DB_NAME. With the legacy driver removed, simplify to a plain ternary — matching how WPDB itself handles the constant.
1 parent 68d63c3 commit 39c1e6a

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

  • packages/plugin-sqlite-database-integration/wp-includes/sqlite

packages/plugin-sqlite-database-integration/wp-includes/sqlite/db.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,7 @@
5151
require_once __DIR__ . '/class-wp-sqlite-db.php';
5252
require_once __DIR__ . '/install-functions.php';
5353

54-
/**
55-
* The DB_NAME constant is required by the new SQLite driver.
56-
*
57-
* There are some existing projects in which the DB_NAME constant is missing in
58-
* wp-config.php. To enable easier early adoption and testing of the new SQLite
59-
* driver, let's allow using a default database name when DB_NAME is not set.
60-
*
61-
* TODO: For version 3.0, enforce the DB_NAME constant and remove the fallback.
62-
*/
63-
if ( defined( 'DB_NAME' ) && '' !== DB_NAME ) {
64-
$db_name = DB_NAME;
65-
} else {
66-
$db_name = apply_filters( 'wp_sqlite_default_db_name', 'database_name_here' );
67-
}
54+
$db_name = defined( 'DB_NAME' ) ? DB_NAME : '';
6855

6956
/*
7057
* Debug: Cross-check with MySQL.

0 commit comments

Comments
 (0)