PluginProbe
SQLite Database Integration / trunk
SQLite Database Integration vtrunk
3.0.2 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 All 32 releases
← All changes | wp-includes/sqlite/db.php +7 -40 2.2.17trunk View file →
@@ -1,19 +1,16 @@
1 1 <?php
2 2 /**
3 3 * Main integration file.
4 - *
5 - * @package wp-sqlite-integration
6 - * @since 1.0.0
7 4 */
8 5
9 6 /**
10 7 * Load the "SQLITE_DRIVER_VERSION" constant.
11 8 */
12 -require_once dirname( __DIR__, 2 ) . '/version.php';
9 +require_once __DIR__ . '/../database/version.php';
13 10
14 11 // Require the constants file.
15 -require_once dirname( __DIR__, 2 ) . '/constants.php';
12 +require_once __DIR__ . '/../../constants.php';
16 13
17 14 // Bail early if DB_ENGINE is not defined as sqlite.
18 15 if ( ! defined( 'DB_ENGINE' ) || 'sqlite' !== DB_ENGINE ) {
19 16 return;
@@ -46,43 +43,13 @@
46 43 'PDO Driver for SQLite is missing.'
47 44 );
48 45 }
49 46
50 -require_once __DIR__ . '/class-wp-sqlite-lexer.php';
51 -require_once __DIR__ . '/class-wp-sqlite-query-rewriter.php';
52 -require_once __DIR__ . '/class-wp-sqlite-translator.php';
53 -require_once __DIR__ . '/class-wp-sqlite-token.php';
54 -require_once __DIR__ . '/class-wp-sqlite-pdo-user-defined-functions.php';
47 +require_once __DIR__ . '/../database/load.php';
55 48 require_once __DIR__ . '/class-wp-sqlite-db.php';
56 49 require_once __DIR__ . '/install-functions.php';
57 50
58 -/**
59 - * The DB_NAME constant is required by the new SQLite driver.
60 - *
61 - * There are some existing projects in which the DB_NAME constant is missing in
62 - * wp-config.php. To enable easier early adoption and testing of the new SQLite
63 - * driver, let's allow using a default database name when DB_NAME is not set.
64 - *
65 - * TODO: For version 3.0, enforce the DB_NAME constant and remove the fallback.
66 - */
67 -if ( defined( 'DB_NAME' ) && '' !== DB_NAME ) {
68 - $db_name = DB_NAME;
69 -} else {
70 - $db_name = apply_filters( 'wp_sqlite_default_db_name', 'database_name_here' );
71 -}
51 +$db_name = defined( 'DB_NAME' ) ? DB_NAME : '';
52 +$GLOBALS['wpdb'] = new WP_SQLite_DB( $db_name );
72 53
73 -/*
74 - * Debug: Cross-check with MySQL.
75 - * This is for debugging purpose only and requires files
76 - * that are present in the GitHub repository
77 - * but not the plugin published on WordPress.org.
78 - */
79 -$crosscheck_tests_file_path = dirname( __DIR__, 2 ) . '/tests/class-wp-sqlite-crosscheck-db.php';
80 -if ( defined( 'SQLITE_DEBUG_CROSSCHECK' ) && SQLITE_DEBUG_CROSSCHECK && file_exists( $crosscheck_tests_file_path ) ) {
81 - require_once $crosscheck_tests_file_path;
82 - $GLOBALS['wpdb'] = new WP_SQLite_Crosscheck_DB( $db_name );
83 -} else {
84 - $GLOBALS['wpdb'] = new WP_SQLite_DB( $db_name );
85 -
86 - // Boot the Query Monitor plugin if it is active.
87 - require_once dirname( __DIR__, 2 ) . '/integrations/query-monitor/boot.php';
88 -}
54 +// Boot the Query Monitor plugin if it is active.
55 +require_once __DIR__ . '/../../integrations/query-monitor/boot.php';