Explicitly load the sqlite-database-integration/php-polyfills.php file
#8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes https://github.com/Automattic/dotcom-forge/issues/10054
In https://github.com/Automattic/dotcom-forge/issues/10054, we discovered that exports are currently broken in Studio when running PHP <8. This happens because
str_ends_withis used in thesqlite-database-integrationcodebase, but that function only became part of PHP's stdlib in version 8. The crux is thatsqlite-database-integrationactually has a polyfill for this function, but that polyfill isn't loaded. This happens because we use thebefore_wp_loadhook for the WP-CLI commands in this project, short-circuiting WP's regular logic for loading mu-plugins. Instead, we manually require files fromsqlite-database-integration, but we hadn't previously includedphp-polyfills.php. This PR fixes that.Testing instructions
composer install --no-dev --optimize-autoloader --ignore-platform-reqsin this repowp-files/sqlite-commandin the Studio repo with a symlink to your localwp-cli-sqlite-commandreponpm start