Commit 643ad121 authored by Dries's avatar Dries

- Patch #363391 by ShawnClark, Dave Reid: add SimpleTest's DomDocument requirement.

parent 63135473
......@@ -107,24 +107,24 @@ function simpletest_requirements($phase) {
$t = get_t();
$has_curl = function_exists('curl_init');
$has_domdocument = class_exists('DOMDocument');
switch ($phase) {
case 'runtime':
$requirements['simpletest'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
'severity' => $has_curl ? REQUIREMENT_OK : REQUIREMENT_ERROR,
);
break;
case 'install':
if (!$has_curl) {
$requirements['simpletest'] = array(
'title' => $t('cURL'),
'severity' => REQUIREMENT_ERROR,
'description' => $t('Simpletest could not be installed because the PHP <a href="!curl_url">cURL</a> library is not available.', array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')),
);
}
break;
$requirements['curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
);
if (!$has_curl) {
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
$requirements['curl']['description'] = $t('Simpletest could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array('@curl_url' => 'http://php.net/manual/en/curl.setup.php'));
}
$requirements['php_domdocument'] = array(
'title' => $t('PHP DOMDocument class'),
'value' => $has_domdocument ? $t('Enabled') : $t('Not found'),
);
if (!$has_domdocument) {
$requirements['php_domdocument']['severity'] = REQUIREMENT_ERROR;
$requirements['php_domdocument']['description'] =t('SimpleTest requires the DOMDocument class to be available. Please check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
}
return $requirements;
......
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