当前位置: 首页>>代码示例>>PHP>>正文


PHP getAllHeaders函数代码示例

本文整理汇总了PHP中getAllHeaders函数的典型用法代码示例。如果您正苦于以下问题:PHP getAllHeaders函数的具体用法?PHP getAllHeaders怎么用?PHP getAllHeaders使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getAllHeaders函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct($file)
 {
     $config = Config::getInstance();
     $this->myLogger = new Logger($file, $config->getEnv("debug_level"));
     $this->mySessionMgr = new Sesiones("AuthManager");
     /* try to retrieve session token */
     $hdrs = getAllHeaders();
     if (!array_key_exists("X-AC-SessionKey", $hdrs)) {
         // $this->myLogger->info("No sessionKey found in request");
         // no key found: assume anonymous login
         $this->level = PERMS_GUEST;
         return;
     }
     /* if found evaluate for expiration and level */
     $sk = $hdrs['X-AC-SessionKey'];
     $obj = $this->getUserByKey($sk);
     $this->myLogger->info("Username:{$obj->Login} Perms:{$obj->Perms}");
     $this->level = $obj->Perms;
     $this->mySessionKey = $sk;
     $this->operador = $obj->ID;
 }
开发者ID:nedy13,项目名称:AgilityContest,代码行数:21,代码来源:AuthManager.php

示例2: headers

    /**
     * Prints a list of all HTTP request headers.
     *
     * @access public
     * @static
     */
    function headers()
    {
        // disabled ?
        //
        if (!krumo::_debug()) {
            return false;
        }
        // render it
        //
        ?>
<div class="krumo-title">
This is a list of all HTTP request headers.
</div>
		<?php 
        return krumo::dump(getAllHeaders());
    }
开发者ID:rfay,项目名称:junker99,代码行数:22,代码来源:class.krumo.php

示例3: headers

	/**
	 * Prints a list of all HTTP request headers.
	 *
	 * @access public
	 * @static
	 */
	public static function headers()
	{
		return static::dump(getAllHeaders());
	}
开发者ID:ralf57,项目名称:fuel,代码行数:10,代码来源:debug.php

示例4: dirname

<?php

$GLOBALS['cacheDir'] = dirname(__FILE__) . DIRECTORY_SEPARATOR . '.cache';
// 从浏览器转发过来的 proxy 请求,$_SERVER['REQUEST_URI'] 是原始的目标网址
$url = $_SERVER['REQUEST_URI'];
$req_headers = getAllHeaders();
list($resp_headers, $resp_body) = loadFromCache($url);
if (empty($resp_body)) {
    list($resp_headers, $resp_body) = doAgent(str_replace('-min.js', '.js', $url), $req_headers);
    if (empty($resp_body)) {
        list($resp_headers, $resp_body) = doAgent($url, $req_headers);
    }
    if (!empty($resp_body)) {
        saveToCache($url, $resp_headers, $resp_body);
    }
}
foreach ($resp_headers as $resp_header) {
    $tokens = explode(':', $resp_header);
    $whitelist = array('content-type', 'last-modified');
    if (in_array(strtolower($tokens[0]), $whitelist)) {
        header($resp_header);
    }
}
echo $resp_body;
function convUrlToFilename($url)
{
    $fnHead = $GLOBALS['cacheDir'] . DIRECTORY_SEPARATOR . md5($url);
    $fnBody = $fnHead . '.';
    preg_match('/^.*(\\.\\w{1,4}).*$/', $url, $matches);
    if (!empty($matches[1])) {
        $fnBody = $fnHead . $matches[1];
开发者ID:k9yhuang,项目名称:cdn-cache,代码行数:31,代码来源:agent.php

示例5: headers

 /**
  * Prints a list of all HTTP request headers.
  *
  * @access public
  * @static
  */
 public static function headers()
 {
     // disabled
     if (!Krumo::_debug()) {
         return false;
     }
     // render it
     print "<div class=\"krumo-title\">This is a list of all HTTP request headers.</div>";
     return Krumo::dump(getAllHeaders());
 }
开发者ID:ycms,项目名称:krumo,代码行数:16,代码来源:class.krumo.php

示例6: array

<?php

// get only
$items = array(array('id' => 1, 'title' => 'Item 1'), array('id' => 2, 'title' => 'Item 2'), array('id' => 3, 'title' => 'Item 3'), array('id' => 4, 'title' => 'Item 4'), array('id' => 5, 'title' => 'Item 5'), array('id' => 6, 'title' => 'Item 6'), array('id' => 7, 'title' => 'Item 7'), array('id' => 8, 'title' => 'Item 8'), array('id' => 9, 'title' => 'Item 9'), array('id' => 10, 'title' => 'Item 10'), array('id' => 11, 'title' => 'Item 11'), array('id' => 12, 'title' => 'Item 12'), array('id' => 13, 'title' => 'Item 13'), array('id' => 14, 'title' => 'Item 14'), array('id' => 15, 'title' => 'Item 15'), array('id' => 16, 'title' => 'Item 16'), array('id' => 17, 'title' => 'Item 17'), array('id' => 18, 'title' => 'Item 18'), array('id' => 19, 'title' => 'Item 19'), array('id' => 20, 'title' => 'Item 20'), array('id' => 21, 'title' => 'Item 21'), array('id' => 22, 'title' => 'Item 22'), array('id' => 23, 'title' => 'Item 23'), array('id' => 24, 'title' => 'Item 24'), array('id' => 25, 'title' => 'Item 25'), array('id' => 26, 'title' => 'Item 26'), array('id' => 27, 'title' => 'Item 27'), array('id' => 28, 'title' => 'Item 28'), array('id' => 29, 'title' => 'Item 29'), array('id' => 30, 'title' => 'Item 30'), array('id' => 31, 'title' => 'Item 31'), array('id' => 32, 'title' => 'Item 32'), array('id' => 33, 'title' => 'Item 33'), array('id' => 34, 'title' => 'Item 34'), array('id' => 35, 'title' => 'Item 35'), array('id' => 36, 'title' => 'Item 36'), array('id' => 37, 'title' => 'Item 37'), array('id' => 38, 'title' => 'Item 38'), array('id' => 39, 'title' => 'Item 39'), array('id' => 40, 'title' => 'Item 40'), array('id' => 41, 'title' => 'Item 41'), array('id' => 42, 'title' => 'Item 42'), array('id' => 43, 'title' => 'Item 43'), array('id' => 44, 'title' => 'Item 44'), array('id' => 45, 'title' => 'Item 45'), array('id' => 46, 'title' => 'Item 46'), array('id' => 47, 'title' => 'Item 47'), array('id' => 48, 'title' => 'Item 48'), array('id' => 49, 'title' => 'Item 49'), array('id' => 50, 'title' => 'Item 50'), array('id' => 51, 'title' => 'Item 51'), array('id' => 52, 'title' => 'Item 52'), array('id' => 53, 'title' => 'Item 53'), array('id' => 54, 'title' => 'Item 54'), array('id' => 55, 'title' => 'Item 55'), array('id' => 56, 'title' => 'Item 56'), array('id' => 57, 'title' => 'Item 57'), array('id' => 58, 'title' => 'Item 58'), array('id' => 59, 'title' => 'Item 59'), array('id' => 60, 'title' => 'Item 60'), array('id' => 61, 'title' => 'Item 61'), array('id' => 62, 'title' => 'Item 62'), array('id' => 63, 'title' => 'Item 63'), array('id' => 64, 'title' => 'Item 64'), array('id' => 65, 'title' => 'Item 65'), array('id' => 66, 'title' => 'Item 66'), array('id' => 67, 'title' => 'Item 67'), array('id' => 68, 'title' => 'Item 68'), array('id' => 69, 'title' => 'Item 69'), array('id' => 70, 'title' => 'Item 70'), array('id' => 71, 'title' => 'Item 71'), array('id' => 72, 'title' => 'Item 72'), array('id' => 73, 'title' => 'Item 73'), array('id' => 74, 'title' => 'Item 74'), array('id' => 75, 'title' => 'Item 75'), array('id' => 76, 'title' => 'Item 76'), array('id' => 77, 'title' => 'Item 77'), array('id' => 78, 'title' => 'Item 78'), array('id' => 79, 'title' => 'Item 79'), array('id' => 80, 'title' => 'Item 80'), array('id' => 81, 'title' => 'Item 81'), array('id' => 82, 'title' => 'Item 82'), array('id' => 83, 'title' => 'Item 83'), array('id' => 84, 'title' => 'Item 84'), array('id' => 85, 'title' => 'Item 85'), array('id' => 86, 'title' => 'Item 86'), array('id' => 87, 'title' => 'Item 87'), array('id' => 88, 'title' => 'Item 88'), array('id' => 89, 'title' => 'Item 89'), array('id' => 90, 'title' => 'Item 90'), array('id' => 91, 'title' => 'Item 91'), array('id' => 92, 'title' => 'Item 92'), array('id' => 93, 'title' => 'Item 93'), array('id' => 94, 'title' => 'Item 94'), array('id' => 95, 'title' => 'Item 95'), array('id' => 96, 'title' => 'Item 96'), array('id' => 97, 'title' => 'Item 97'), array('id' => 98, 'title' => 'Item 98'), array('id' => 99, 'title' => 'Item 99'), array('id' => 100, 'title' => 'Item 100'), array('id' => 101, 'title' => 'Item 101'));
$headers = getAllHeaders();
list($offset, $limit) = explode('-', str_replace('items=', '', $headers['Range']));
$l1 = $limit - $offset;
$result = array_slice($items, $offset, $l1 + 1);
//header("Content-Range: items={$offset}-{$limit}/" . (string)(count($items) - 1));
echo json_encode($result);
开发者ID:peterivan,项目名称:PWL,代码行数:10,代码来源:service.php

示例7: headers

 /**
  * Prints a list of all HTTP request headers.
  *
  * @access public
  * @static
  */
 public static function headers()
 {
     // disabled ?
     if (!APrint::_debug()) {
         return false;
     }
     // render it
     return '<div class="aprint-title">This is a list of all HTTP request headers.</div>' . APrint::dump(getAllHeaders());
 }
开发者ID:Sajaki,项目名称:wowroster,代码行数:15,代码来源:aprint.php

示例8: headers

 /**
  * Prints a list of all HTTP request headers.
  *
  * @access public
  * @static
  */
 public static function headers()
 {
     // deal with fcgi installs on PHP 5.3
     if (version_compare(PHP_VERSION, '5.4.0') < 0 and !function_exists('apache_request_headers')) {
         $headers = array();
         foreach (\Input::server() as $name => $value) {
             if (strpos($name, 'HTTP_') === 0) {
                 $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
                 $headers[$name] = $value;
             } elseif ($name == 'CONTENT_TYPE') {
                 $headers['Content-Type'] = $value;
             } elseif ($name == 'CONTENT_LENGTH') {
                 $headers['Content-Length'] = $value;
             }
         }
     } else {
         $headers = getAllHeaders();
     }
     return static::dump($headers);
 }
开发者ID:wushian,项目名称:MDD,代码行数:26,代码来源:debug.php

示例9: headers

 /**
  * Prints a list of all HTTP request headers.
  *
  * @access public
  * @static
  */
 public static function headers()
 {
     // disabled
     if (!static::_debug()) {
         return false;
     }
     // render it
     static::heading("This is a list of all HTTP request headers.");
     return static::dump(getAllHeaders());
 }
开发者ID:mmucklo,项目名称:krumo,代码行数:16,代码来源:class.krumo.php

示例10: user_login

 /**
  * @return string
  */
 static function user_login()
 {
     $headers = getAllHeaders();
     $auth = trim($headers['Authorization']);
     if ($m = Core_Regexps::match_with_results('{^Basic\\s+(.+)$}', $auth)) {
         $auth = Core_Strings::decode64($m[1]);
         if ($m = Core_Regexps::match_with_results('{^([^:]+):}', $auth)) {
             $login = trim($m[1]);
             if ($login != '') {
                 return $login;
             }
         }
     }
     return false;
 }
开发者ID:techart,项目名称:tao,代码行数:18,代码来源:CMS.php


注:本文中的getAllHeaders函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。