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

Issue #2160643 by jhedstrom, dawehener: Add status report "requirement" for...

Issue #2160643 by jhedstrom, dawehener: Add status report "requirement" for Twig C extension for PHP
parent 7342df62
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
...@@ -648,6 +648,22 @@ function system_requirements($phase) { ...@@ -648,6 +648,22 @@ function system_requirements($phase) {
} }
} }
// Check if the Twig C extension is available.
if ($phase == 'runtime') {
$url = 'http://twig.sensiolabs.org/doc/installation.html#installing-the-c-extension';
$requirements['twig_c_extension'] = [
'title' => t('Twig C extension'),
'severity' => REQUIREMENT_INFO,
];
if (!function_exists('twig_template_get_attributes')) {
$requirements['twig_c_extension']['value'] = t('Not available');
$requirements['twig_c_extension']['description'] = t('Enabling the Twig C extension can greatly increase rendering performance. See <a href="@url">the installation instructions</a> for more detail.', ['@url' => $url]);
}
else {
$requirements['twig_c_extension']['description'] = t('The <a href="@url">Twig C extension</a> is available', ['@url' => $url]);
}
}
return $requirements; return $requirements;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment