PluginProbe
SQLite Database Integration / 2.2.7
SQLite Database Integration v2.2.7
3.0.1 trunk 2.1.13 2.1.14 2.1.15 2.1.16 2.2.0 2.2.1 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.17 2.2.18 2.2.19 2.2.2 2.2.20 2.2.21 2.2.22 2.2.23 2.2.3 2.2.4 All 31 releases
sqlite-database-integration / constants.php

constants.php in SQLite Database Integration 2.2.7, at constants.php

59 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Define constants for the SQLite implementation.
4 *
5 * @since 1.0.0
6 * @package wp-sqlite-integration
7 */
8
9 // Temporary - This will be in wp-config.php once SQLite is merged in Core.
10 if ( ! defined( 'DB_ENGINE' ) ) {
11 if ( defined( 'SQLITE_DB_DROPIN_VERSION' ) ) {
12 define( 'DB_ENGINE', 'sqlite' );
13 } elseif ( defined( 'DATABASE_ENGINE' ) ) {
14 // backwards compatibility with previous versions of the plugin.
15 define( 'DB_ENGINE', DATABASE_ENGINE );
16 } else {
17 define( 'DB_ENGINE', 'mysql' );
18 }
19 }
20
21 /**
22 * Notice:
23 * Your scripts have the permission to create directories or files on your server.
24 * If you write in your wp-config.php like below, we take these definitions.
25 * define('DB_DIR', '/full_path_to_the_database_directory/');
26 * define('DB_FILE', 'database_file_name');
27 */
28
29 /**
30 * FQDBDIR is a directory where the sqlite database file is placed.
31 * If DB_DIR is defined, it is used as FQDBDIR.
32 */
33 if ( ! defined( 'FQDBDIR' ) ) {
34 if ( defined( 'DB_DIR' ) ) {
35 define( 'FQDBDIR', trailingslashit( DB_DIR ) );
36 } elseif ( defined( 'WP_CONTENT_DIR' ) ) {
37 define( 'FQDBDIR', WP_CONTENT_DIR . '/database/' );
38 } else {
39 define( 'FQDBDIR', ABSPATH . 'wp-content/database/' );
40 }
41 }
42
43 /**
44 * FQDB is a database file name. If DB_FILE is defined, it is used
45 * as FQDB.
46 */
47 if ( ! defined( 'FQDB' ) ) {
48 if ( defined( 'DB_FILE' ) ) {
49 define( 'FQDB', FQDBDIR . DB_FILE );
50 } else {
51 define( 'FQDB', FQDBDIR . '.ht.sqlite' );
52 }
53 }
54
55 // Allow enabling the SQLite AST driver via environment variable.
56 if ( ! defined( 'WP_SQLITE_AST_DRIVER' ) && isset( $_ENV['WP_SQLITE_AST_DRIVER'] ) && 'true' === $_ENV['WP_SQLITE_AST_DRIVER'] ) {
57 define( 'WP_SQLITE_AST_DRIVER', true );
58 }
59