-
Notifications
You must be signed in to change notification settings - Fork 1
Load polyfills correctly for the new sqlite version (v2.2.22) #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2038ecc
100d0a4
316c5f4
3fce617
7574650
c7e8117
5389763
248c544
3b1aba5
4b85b4f
5240b5f
6744ef7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,20 +76,23 @@ public static function load_plugin() { | |
| if ( version_compare( $sqlite_plugin_version, '2.1.11', '<' ) ) { | ||
| WP_CLI::error( 'The SQLite integration plugin must be version 2.1.11 or higher.' ); | ||
| } | ||
katinthehatsite marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Load the translator class from the plugin. | ||
| if ( ! defined( 'SQLITE_DB_DROPIN_VERSION' ) ) { | ||
| define( 'SQLITE_DB_DROPIN_VERSION', $sqlite_plugin_version ); // phpcs:ignore | ||
| } | ||
|
|
||
| // We also need to selectively load the necessary classes from the plugin. | ||
| require_once $plugin_directory . '/php-polyfills.php'; | ||
| require_once $plugin_directory . '/constants.php'; | ||
|
|
||
| $new_driver_enabled = defined( 'WP_SQLITE_AST_DRIVER' ) && WP_SQLITE_AST_DRIVER; | ||
| $old_structure = file_exists( $plugin_directory . '/php-polyfills.php' ); | ||
|
|
||
| if ( $old_structure ) { | ||
| require_once $plugin_directory . '/php-polyfills.php'; | ||
| } | ||
| require_once $plugin_directory . '/constants.php'; | ||
|
|
||
| if ( $new_driver_enabled && file_exists( $plugin_directory . '/wp-pdo-mysql-on-sqlite.php' ) ) { | ||
| require_once $plugin_directory . '/wp-pdo-mysql-on-sqlite.php'; | ||
| } elseif ( $new_driver_enabled && file_exists( $plugin_directory . '/wp-includes/database/load.php' ) ) { | ||
| require_once $plugin_directory . '/wp-includes/database/load.php'; | ||
| } elseif ( $new_driver_enabled ) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @katinthehatsite This branch actually also needs to stay in the code for now. I guess I should've expressed it clearer, as in, let's only add the new case to the existing ones: } elseif ( file_exists( $plugin_directory . '/wp-includes/database/load.php' ) ) {
require_once $plugin_directory . '/wp-includes/database/load.php';
}
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added them back now 👍 |
||
| require_once $plugin_directory . '/version.php'; | ||
| require_once $plugin_directory . '/wp-includes/parser/class-wp-parser-grammar.php'; | ||
|
|
@@ -108,11 +111,12 @@ public static function load_plugin() { | |
| require_once $plugin_directory . '/wp-includes/sqlite-ast/class-wp-sqlite-information-schema-exception.php'; | ||
| require_once $plugin_directory . '/wp-includes/sqlite-ast/class-wp-sqlite-information-schema-reconstructor.php'; | ||
| } else { | ||
| require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-lexer.php'; | ||
| require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-query-rewriter.php'; | ||
| require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-translator.php'; | ||
| require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-token.php'; | ||
| require_once $plugin_directory . '/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php'; | ||
| $sqlite = $plugin_directory . '/wp-includes/sqlite'; | ||
| require_once "$sqlite/class-wp-sqlite-lexer.php"; | ||
| require_once "$sqlite/class-wp-sqlite-query-rewriter.php"; | ||
| require_once "$sqlite/class-wp-sqlite-translator.php"; | ||
| require_once "$sqlite/class-wp-sqlite-token.php"; | ||
| require_once "$sqlite/class-wp-sqlite-pdo-user-defined-functions.php"; | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried without these but it did not work for using
wp-cli/wp-cli": "^2.13so Claude recommended adding this