Skip to content

Commit 3829390

Browse files
committed
Add a fallback for missing DB_NAME constant
1 parent d426211 commit 3829390

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/SQLiteDriverFactory.php‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ public static function create_driver() {
2121
'path' => FQDB,
2222
)
2323
);
24-
return new WP_SQLite_Driver( $connection, DB_NAME );
24+
if ( defined( 'DB_NAME' ) && '' !== DB_NAME ) {
25+
$db_name = DB_NAME;
26+
} else {
27+
$db_name = 'database_name_here';
28+
}
29+
return new WP_SQLite_Driver( $connection, $db_name );
2530
}
2631

2732
return new WP_SQLite_Translator();

0 commit comments

Comments
 (0)