summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-04-28 09:30:35 +0000
committerDries Buytaert <dries@buytaert.net>2008-04-28 09:30:35 +0000
commitbc8a2b23da92545b9e13299126dac8c381ddbbf6 (patch)
tree9411500b47b17049fabfacbad308d38559016f87 /modules
parentab6c47cd3d464e6e6226b5f9d401bf0e94fba4b4 (diff)
downloadbrdo-bc8a2b23da92545b9e13299126dac8c381ddbbf6.tar.gz
brdo-bc8a2b23da92545b9e13299126dac8c381ddbbf6.tar.bz2
- Patch #251550 by ksenzee: simpletest requires curl so make sure to add a requirements check.
Diffstat (limited to 'modules')
-rw-r--r--modules/simpletest/simpletest.install37
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/simpletest/simpletest.install b/modules/simpletest/simpletest.install
index 4287b2a5d..25b828698 100644
--- a/modules/simpletest/simpletest.install
+++ b/modules/simpletest/simpletest.install
@@ -96,3 +96,40 @@ function simpletest_uninstall() {
variable_del('simpletest_httpauth_pass');
variable_del('simpletest_devel');
}
+
+/**
+ * Check that the cURL extension exists for PHP.
+ */
+function simpletest_requirements($phase) {
+ $requirements = array();
+ $t = get_t();
+
+ $has_curl = function_exists('curl_init');
+
+ 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_OK,
+ );
+ }
+ else {
+ $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;
+ }
+
+ return $requirements;
+}