Skip to content

Commit 14f6808

Browse files
committed
Bump minimum SQLite plugin version to 2.2.0
SQLITE_DRIVER_VERSION was introduced in 2.1.17-alpha; 2.2.0 is the first stable release after 2.1.16, so require that as the floor.
1 parent bb6f4f9 commit 14f6808

1 file changed

Lines changed: 9 additions & 25 deletions

File tree

‎src/SQLiteDatabaseIntegrationLoader.php‎

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,6 @@ final class SQLiteDatabaseIntegrationLoader {
1212
* @return false|string The version of the SQLite integration plugin or false if not found/activated.
1313
*/
1414
public static function get_plugin_version() {
15-
$plugin_path = self::get_plugin_directory();
16-
if ( ! $plugin_path ) {
17-
return false;
18-
}
19-
20-
$version_file = $plugin_path . '/wp-includes/database/version.php';
21-
if ( ! file_exists( $version_file ) ) {
22-
return false;
23-
}
24-
25-
require_once $version_file;
26-
2715
return defined( 'SQLITE_DRIVER_VERSION' ) ? SQLITE_DRIVER_VERSION : false;
2816
}
2917

@@ -60,19 +48,6 @@ public static function load_plugin() {
6048
WP_CLI::error( 'Could not locate the SQLite integration plugin.' );
6149
}
6250

63-
$sqlite_plugin_version = self::get_plugin_version();
64-
if ( ! $sqlite_plugin_version ) {
65-
WP_CLI::error( 'Could not determine the version of the SQLite integration plugin.' );
66-
}
67-
68-
if ( version_compare( $sqlite_plugin_version, '2.1.11', '<' ) ) {
69-
WP_CLI::error( 'The SQLite integration plugin must be version 2.1.11 or higher.' );
70-
}
71-
// Load the translator class from the plugin.
72-
if ( ! defined( 'SQLITE_DB_DROPIN_VERSION' ) ) {
73-
define( 'SQLITE_DB_DROPIN_VERSION', $sqlite_plugin_version ); // phpcs:ignore
74-
}
75-
7651
$new_driver_enabled = defined( 'WP_SQLITE_AST_DRIVER' ) && WP_SQLITE_AST_DRIVER;
7752
$old_structure = file_exists( $plugin_directory . '/php-polyfills.php' );
7853

@@ -110,5 +85,14 @@ public static function load_plugin() {
11085
require_once "$sqlite/class-wp-sqlite-token.php";
11186
require_once "$sqlite/class-wp-sqlite-pdo-user-defined-functions.php";
11287
}
88+
89+
$sqlite_plugin_version = self::get_plugin_version();
90+
if ( ! $sqlite_plugin_version ) {
91+
WP_CLI::error( 'Could not determine the version of the SQLite integration plugin.' );
92+
}
93+
94+
if ( version_compare( $sqlite_plugin_version, '2.2.0', '<' ) ) {
95+
WP_CLI::error( 'The SQLite integration plugin must be version 2.2.0 or higher.' );
96+
}
11397
}
11498
}

0 commit comments

Comments
 (0)