当前位置: 首页>>代码示例>>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;未经允许,请勿转载。