| @@ -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,25 +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 | - * Debug: Cross-check with MySQL. | |
| 60 | - * This is for debugging purpose only and requires files | |
| 61 | - * that are present in the GitHub repository | |
| 62 | - * but not the plugin published on WordPress.org. | |
| 63 | - */ | |
| 64 | -$crosscheck_tests_file_path = dirname( __DIR__, 2 ) . '/tests/class-wp-sqlite-crosscheck-db.php'; | |
| 65 | -if ( defined( 'SQLITE_DEBUG_CROSSCHECK' ) && SQLITE_DEBUG_CROSSCHECK && file_exists( $crosscheck_tests_file_path ) ) { | |
| 66 | - require_once $crosscheck_tests_file_path; | |
| 67 | - $GLOBALS['wpdb'] = new WP_SQLite_Crosscheck_DB( DB_NAME ); | |
| 68 | -} else { | |
| 69 | - $GLOBALS['wpdb'] = new WP_SQLite_DB( defined( 'DB_NAME' ) ? DB_NAME : '' ); | |
| 70 | -} | |
| 51 | +$db_name = defined( 'DB_NAME' ) ? DB_NAME : ''; | |
| 52 | +$GLOBALS['wpdb'] = new WP_SQLite_DB( $db_name ); | |
| 53 | + | |
| 54 | +// Boot the Query Monitor plugin if it is active. | |
| 55 | +require_once __DIR__ . '/../../integrations/query-monitor/boot.php'; | |