Skip to content

Commit 186fd29

Browse files
committed
DRY
1 parent 4ee087b commit 186fd29

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/DB_Command_SQLite.php‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ protected function get_sqlite_db_path() {
6868
return FQDB;
6969
}
7070

71+
$wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
72+
7173
// Check for FQDBDIR and construct path.
72-
$db_dir = defined( 'FQDBDIR' ) ? FQDBDIR : ( defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content' ) . '/database';
74+
$db_dir = defined( 'FQDBDIR' ) ? FQDBDIR : $wp_content_dir . '/database';
7375
$db_file = defined( 'DB_FILE' ) ? DB_FILE : '.ht.sqlite';
7476

7577
$db_path = rtrim( $db_dir, '/' ) . '/' . ltrim( $db_file, '/' );
@@ -80,8 +82,7 @@ protected function get_sqlite_db_path() {
8082
}
8183

8284
// Try alternative common locations.
83-
$wp_content_dir = defined( 'WP_CONTENT_DIR' ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
84-
$alt_paths = [
85+
$alt_paths = [
8586
$wp_content_dir . '/database/.ht.sqlite',
8687
$wp_content_dir . '/.ht.sqlite',
8788
ABSPATH . '.ht.sqlite',

0 commit comments

Comments
 (0)