PluginProbe
SQLite Database Integration / trunk
SQLite Database Integration vtrunk
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 / wp-includes / sqlite / db.php

db.php in SQLite Database Integration trunk, at wp-includes/sqlite/db.php

56 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main integration file.
4 */
5
6 /**
7 * Load the "SQLITE_DRIVER_VERSION" constant.
8 */
9 require_once __DIR__ . '/../database/version.php';
10
11 // Require the constants file.
12 require_once __DIR__ . '/../../constants.php';
13
14 // Bail early if DB_ENGINE is not defined as sqlite.
15 if ( ! defined( 'DB_ENGINE' ) || 'sqlite' !== DB_ENGINE ) {
16 return;
17 }
18
19 if ( ! extension_loaded( 'pdo' ) ) {
20 wp_die(
21 new WP_Error(
22 'pdo_not_loaded',
23 sprintf(
24 '<h1>%1$s</h1><p>%2$s</p>',
25 'PHP PDO Extension is not loaded',
26 'Your PHP installation appears to be missing the PDO extension which is required for this version of WordPress and the type of database you have specified.'
27 )
28 ),
29 'PHP PDO Extension is not loaded.'
30 );
31 }
32
33 if ( ! extension_loaded( 'pdo_sqlite' ) ) {
34 wp_die(
35 new WP_Error(
36 'pdo_driver_not_loaded',
37 sprintf(
38 '<h1>%1$s</h1><p>%2$s</p>',
39 'PDO Driver for SQLite is missing',
40 'Your PHP installation appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.'
41 )
42 ),
43 'PDO Driver for SQLite is missing.'
44 );
45 }
46
47 require_once __DIR__ . '/../database/load.php';
48 require_once __DIR__ . '/class-wp-sqlite-db.php';
49 require_once __DIR__ . '/install-functions.php';
50
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';
56