Skip to content

Commit c63607e

Browse files
committed
Remove all remaining usages of SQLite 3
1 parent 487bf54 commit c63607e

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

activate.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ function ( $result ) {
7575
* When the plugin gets merged in wp-core, this is not to be ported.
7676
*/
7777
function sqlite_plugin_copy_db_file() {
78-
// Bail early if the SQLite3 class does not exist.
79-
if ( ! class_exists( 'SQLite3' ) ) {
78+
// Bail early if the PDO SQLite extension is not loaded.
79+
if ( ! extension_loaded( 'pdo_sqlite' ) ) {
8080
return;
8181
}
8282

admin-notices.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ function sqlite_plugin_admin_notice() {
1919
return;
2020
}
2121

22-
// If SQLite is not detected, bail early.
23-
if ( ! class_exists( 'SQLite3' ) ) {
22+
// If PDO SQLite is not loaded, bail early.
23+
if ( ! extension_loaded( 'pdo_sqlite' ) ) {
2424
printf(
2525
'<div class="notice notice-error"><p>%s</p></div>',
26-
esc_html__( 'The SQLite Integration plugin is active, but the SQLite3 class is missing from your server. Please make sure that SQLite is enabled in your PHP installation.', 'sqlite-database-integration' )
26+
esc_html__( 'The SQLite Integration plugin is active, but the PDO SQLite extension is missing from your server. Please make sure that PDO SQLite is enabled in your PHP installation.', 'sqlite-database-integration' )
2727
);
2828
return;
2929
}

admin-page.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ function sqlite_integration_admin_screen() {
4747
?>
4848
</p>
4949
<?php else : ?>
50-
<?php if ( ! class_exists( 'SQLite3' ) ) : ?>
51-
<div class="notice notice-error">
52-
<p><?php esc_html_e( 'We detected that the SQLite3 class is missing from your server. Please make sure that SQLite is enabled in your PHP installation before proceeding.', 'sqlite-database-integration' ); ?></p>
53-
</div>
54-
<?php elseif ( ! extension_loaded( 'pdo_sqlite' ) ) : ?>
50+
<?php if ( ! extension_loaded( 'pdo_sqlite' ) ) : ?>
5551
<div class="notice notice-error">
5652
<p><?php esc_html_e( 'We detected that the PDO SQLite driver is missing from your server (the pdo_sqlite extension is not loaded). Please make sure that SQLite is enabled in your PHP installation before proceeding.', 'sqlite-database-integration' ); ?></p>
5753
</div>

health-check.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function sqlite_plugin_filter_debug_data( $info ) {
3131
if ( 'sqlite' === $db_engine ) {
3232
$info['wp-database']['fields']['database_version'] = array(
3333
'label' => __( 'SQLite version', 'sqlite-database-integration' ),
34-
'value' => class_exists( 'SQLite3' ) ? SQLite3::version()['versionString'] : null,
34+
'value' => $info['wp-database']['fields']['server_version'] ?? null,
3535
);
3636

3737
$info['wp-database']['fields']['database_file'] = array(

0 commit comments

Comments
 (0)