-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Explicitly require the hash
extension.
#8138
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
@dd32 I would like to ask you to double check those stats you pulled about the |
PHP 7.4 is the first version to properly bundle the hash extension, so prior to PHP 7.4, it is technically possible to compile PHP without the hash extension. |
@johnbillion In it's current form, the error will only show the first extension that is missing. If an install is missing both required extensions, I think it would be helpful to include that in the WP_Error. Does something like this work? // Add a warning when required PHP extensions are missing.
$required_php_extensions = array( 'json', 'hash' );
$missing_php_extensions = array();
foreach ( $required_php_extensions as $required_php_extension ) {
if ( ! extension_loaded( $required_php_extension ) ) {
$missing_php_extensions[] = $required_php_extension;
}
}
if ( ! empty( $missing_php_extensions ) ) {
$php_extension_error = new WP_Error();
foreach ( $missing_php_extensions as $missing_php_extension ) {
$php_extension_error->add(
"php_not_compatible_{$missing_php_extension}",
sprintf(
/* translators: 1: WordPress version number, 2: The PHP extension name needed. */
__( 'The update cannot be installed because WordPress %1$s requires the %2$s PHP extension.' ),
$wp_version,
strtoupper( $missing_php_extension )
)
);
}
return $php_extension_error;
} |
@peterwilsoncc Good point, I'll take a look |
So we've a catch-22 situation here, the code in For future-proofing we could introduce a |
Trac ticket: https://core.trac.wordpress.org/ticket/62815