Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues #450: Report cURL status only if it’s needed and is lacking. #469

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions payment/uc_authorizenet/uc_authorizenet.install
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ function uc_authorizenet_requirements($phase) {

$has_curl = function_exists('curl_init');

$requirements['uc_authorizenet_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
);
if (!$has_curl) {
$requirements['uc_authorizenet_curl']['severity'] = REQUIREMENT_ERROR;
$requirements['uc_authorizenet_curl']['description'] = $t("Authorize.net requires the PHP <a href='!curl_url'>cURL</a> library.", array('!curl_url' => 'http://php.net/manual/en/curl.setup.php'));
$requirements['uc_authorizenet_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('cURL not found'),
bugfolder marked this conversation as resolved.
Show resolved Hide resolved
'description' => $t("Authorize.net requires the PHP <a href='!curl_url'>cURL</a> library.", array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')),
'severity' => REQUIREMENT_ERROR,
);
}

return $requirements;
Expand Down
14 changes: 7 additions & 7 deletions payment/uc_cybersource/uc_cybersource.install
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ function uc_cybersource_requirements($phase) {

// Using POST with cURL.
elseif ($method == 'post') {
$requirements['uc_cybersource_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
);
if (!$has_curl) {
$requirements['uc_cybersource_curl']['severity'] = REQUIREMENT_ERROR;
$requirements['uc_cybersource_curl']['description'] = $t("CyberSource's Silent Order POST requires the PHP <a href='!curl_url'>cURL</a> library.", array('!curl_url' => 'http://php.net/manual/en/curl.setup.php'));
$requirements['uc_cybersource_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('cURL not found'),
argiepiano marked this conversation as resolved.
Show resolved Hide resolved
'description' => $t("CyberSource's Silent Order POST requires the PHP <a href='!curl_url'>cURL</a> library.", array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')),
'severity' => REQUIREMENT_ERROR,
);
}
}

Expand All @@ -48,7 +48,7 @@ function uc_cybersource_requirements($phase) {
$has_cybersource_hop = uc_cybersource_hop_include();
$requirements['uc_cybersource'] = array(
'title' => t('CyberSource HOP.php'),
'value' => $has_cybersource_hop ? $t('Enabled') : $t('Not found'),
'value' => $has_cybersource_hop ? $t('Enabled') : $t('HOP.php not found'),
);
if (!$has_cybersource_hop) {
$requirements['uc_cybersource']['description'] = t('For instructions on how to generate this file, please refer to <a href="http://www.cybersource.com/support_center/implementation/downloads/hosted_order_page/">CyberSource\'s Hosted Order Pages Documentation</a>, specifically the "Downloading Security Scripts" in Chapter 2 of the <a href="http://apps.cybersource.com/library/documentation/sbc/HOP_UG/html/">HOP User\'s Guide</a>.');
Expand Down
12 changes: 6 additions & 6 deletions payment/uc_paypal/uc_paypal.install
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ function uc_paypal_requirements($phase) {

// PayPal WPP requires cURL.
if (config_get('uc_payment.settings', 'uc_pg_paypal_wpp_enabled')) {
$requirements['uc_paypal_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('Not found'),
);
if (!$has_curl) {
$requirements['uc_paypal_curl']['severity'] = REQUIREMENT_ERROR;
$requirements['uc_paypal_curl']['description'] = $t("PayPal WPP requires the PHP <a href='!curl_url'>cURL</a> library.", array('!curl_url' => 'http://php.net/manual/en/curl.setup.php'));
$requirements['uc_paypal_curl'] = array(
'title' => $t('cURL'),
'value' => $has_curl ? $t('Enabled') : $t('cURL not found'),
argiepiano marked this conversation as resolved.
Show resolved Hide resolved
'description' =>$t("PayPal WPP requires the PHP <a href='!curl_url'>cURL</a> library.", array('!curl_url' => 'http://php.net/manual/en/curl.setup.php')),
'severity' => REQUIREMENT_ERROR,
);
}
}

Expand Down