Commit f617434e authored by alexpott's avatar alexpott

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
......@@ -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(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment