Skip to content
Snippets Groups Projects
Commit f617434e authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2502507 by cilefen, umarzaffer: Add a hook_requirements() warning if no...

Issue #2502507 by cilefen, umarzaffer: Add a hook_requirements() warning if no opcode cache is enabled
parent 2c2042f9
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -241,6 +241,22 @@ function system_requirements($phase) {
$requirements['php_extensions']['value'] = t('Enabled');
}
if ($phase == 'install' || $phase == 'runtime') {
// Check to see if OPcache is installed.
$opcache_enabled = (function_exists('opcache_get_status') && opcache_get_status()['opcache_enabled']);
if (!$opcache_enabled) {
$requirements['php_opcache'] = array(
'value' => t('Not enabled'),
'severity' => REQUIREMENT_WARNING,
'description' => t('PHP OPcode caching can improve your site\'s performance considerably. It is <strong>highly recommended</strong> to have <a href="@opcache_link" target="_blank">OPcache</a> installed on your server.', array('@opcache_link' => 'http://php.net/manual/en/opcache.installation.php')),
);
}
else {
$requirements['php_opcache']['value'] = t('Enabled');
}
$requirements['php_opcache']['title'] = t('PHP OPcode caching');
}
if ($phase == 'install' || $phase == 'update') {
// Test for PDO (database).
$requirements['database_extensions'] = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment