本文整理汇总了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;
}
}