-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Define constants for the SQLite implementation. | ||
* | ||
* @since n.e.x.t | ||
* @package performance-lab | ||
*/ | ||
|
||
// Temporary - This will be in wp-config.php once SQLite is merged in Core. | ||
if ( ! defined( 'DATABASE_TYPE' ) ) { | ||
define( 'DATABASE_TYPE', 'sqlite' ); | ||
} | ||
|
||
/** | ||
* Notice: | ||
* Your scripts have the permission to create directories or files on your server. | ||
* If you write in your wp-config.php like below, we take these definitions. | ||
* define('DB_DIR', '/full_path_to_the_database_directory/'); | ||
* define('DB_FILE', 'database_file_name'); | ||
*/ | ||
|
||
/** | ||
* FQDBDIR is a directory where the sqlite database file is placed. | ||
* If DB_DIR is defined, it is used as FQDBDIR. | ||
*/ | ||
if ( ! defined( 'FQDBDIR' ) ) { | ||
if ( defined( 'DB_DIR' ) ) { | ||
define( 'FQDBDIR', trailingslashit( DB_DIR ) ); | ||
} elseif ( defined( 'WP_CONTENT_DIR' ) ) { | ||
define( 'FQDBDIR', WP_CONTENT_DIR . '/database/' ); | ||
} else { | ||
define( 'FQDBDIR', ABSPATH . 'wp-content/database/' ); | ||
} | ||
} | ||
|
||
/** | ||
* FQDB is a database file name. If DB_FILE is defined, it is used | ||
* as FQDB. | ||
*/ | ||
if ( ! defined( 'FQDB' ) ) { | ||
if ( defined( 'DB_FILE' ) ) { | ||
define( 'FQDB', FQDBDIR . DB_FILE ); | ||
} else { | ||
define( 'FQDB', FQDBDIR . '.ht.sqlite' ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters