當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Http::getHeaders方法代碼示例

本文整理匯總了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;
}
開發者ID:OneataBogdan,項目名稱:lead_coriolan,代碼行數:16,代碼來源:actions.functions.post.php

示例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;
 }
開發者ID:OneataBogdan,項目名稱:lead_coriolan,代碼行數:25,代碼來源:Validators.php

示例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;
    }
}
開發者ID:askzap,項目名稱:ultimate,代碼行數:21,代碼來源:eway_rapidapi.functions.php


注:本文中的Tygh\Http::getHeaders方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。