Skip to content

Commit e7e411d

Browse files
authored
Use default value when DB_NAME constant is not defined (#203)
2 parents 14fc4ed + f8894c7 commit e7e411d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

constants.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@
5252
}
5353
}
5454

55+
/**
56+
* The DB_NAME constant is required by the SQLite driver.
57+
*
58+
* When DB_NAME is not defined, let's use a default value that corresponds to
59+
* the default value of the constant in "wp-config-sample.php" and in Studio.
60+
*/
61+
if ( ! defined( 'DB_NAME' ) ) {
62+
define( 'DB_NAME', 'database_name_here' );
63+
}
64+
5565
// Allow enabling the SQLite AST driver via environment variable.
5666
if ( ! defined( 'WP_SQLITE_AST_DRIVER' ) && isset( $_ENV['WP_SQLITE_AST_DRIVER'] ) && 'true' === $_ENV['WP_SQLITE_AST_DRIVER'] ) {
5767
define( 'WP_SQLITE_AST_DRIVER', true );

0 commit comments

Comments
 (0)