本文整理匯總了PHP中Tygh\Http::getHeaders方法的典型用法代碼示例。如果您正苦於以下問題:PHP Http::getHeaders方法的具體用法?PHP Http::getHeaders怎麽用?PHP Http::getHeaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tygh\Http
的用法示例。
在下文中一共展示了Http::getHeaders方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fn_settings_actions_addons_seo
/**
* Check if mod_rewrite is active and clean up templates cache
*/
function fn_settings_actions_addons_seo(&$new_value, $old_value)
{
if ($new_value == 'A') {
Http::get(Registry::get('config.http_location') . '/catalog.html?version');
$headers = Http::getHeaders();
if (strpos($headers, '200 OK') === false) {
$new_value = 'D';
fn_set_notification('W', __('warning'), __('warning_seo_urls_disabled'));
}
}
fn_clear_cache();
return true;
}
示例2: isModRewriteEnabled
/**
* Check if mod_rewrite is available
*
* @return bool true if available
*/
public function isModRewriteEnabled()
{
if (defined('PRODUCT_EDITION') && PRODUCT_EDITION == 'ULTIMATE') {
// IIS Web-Servers fix
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'], 1);
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
$url = 'http://' . $_SERVER['HTTP_HOST'] . str_replace('index.php', '', $_SERVER['REQUEST_URI']);
$url .= 'mod_rewrite';
Http::get($url);
$headers = Http::getHeaders();
if (strpos($headers, '200 OK') === false) {
return false;
}
}
return true;
}
示例3: fn_eway_rapidapi_request
function fn_eway_rapidapi_request($point, $request, $processor_data, &$response, $post = true)
{
if ($processor_data['processor_params']['mode'] == 'test') {
$request_url = 'https://api.sandbox.ewaypayments.com/';
} else {
$request_url = 'https://api.ewaypayments.com/';
}
if ($post) {
$response = Http::post($request_url . $point, json_encode($request), array('basic_auth' => array($processor_data['processor_params']['username'], $processor_data['processor_params']['password']), 'headers' => array("Content-Type: application/json")));
} else {
$response = Http::get($request_url . $point, $request, array('basic_auth' => array($processor_data['processor_params']['username'], $processor_data['processor_params']['password'])));
}
$headers = preg_split("/[\\s]/", Http::getHeaders(), 4);
if ($headers[1] == '200') {
$response = json_decode($response);
return true;
} else {
$response = $headers[1] . ' ' . $headers[2];
return false;
}
}