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


PHP OAuthRequest::get_headers方法代码示例

本文整理汇总了PHP中OAuthRequest::get_headers方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuthRequest::get_headers方法的具体用法?PHP OAuthRequest::get_headers怎么用?PHP OAuthRequest::get_headers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OAuthRequest的用法示例。


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

示例1: from_request

 /**
  * attempt to build up a request from what was passed to the server
  */
 public static function from_request($http_method = NULL, $http_url = NULL, $parameters = NULL)
 {
     /*{{{*/
     $scheme = !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on" ? 'http' : 'https';
     @$http_url or $http_url = $scheme . '://' . $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
     @$http_method or $http_method = $_SERVER['REQUEST_METHOD'];
     $request_headers = OAuthRequest::get_headers();
     // let the library user override things however they'd like, if they know
     // which parameters to use then go for it, for example XMLRPC might want to
     // do this
     if ($parameters) {
         $req = new OAuthRequest($http_method, $http_url, $parameters);
     } else {
         // collect request parameters from query string (GET) and post-data (POST) if appropriate (note: POST vars have priority)
         $req_parameters = $_GET;
         if ($http_method == "POST" && @strstr($request_headers["Content-Type"], "application/x-www-form-urlencoded")) {
             $req_parameters = array_merge($req_parameters, $_POST);
         }
         // next check for the auth header, we need to do some extra stuff
         // if that is the case, namely suck in the parameters from GET or POST
         // so that we can include them in the signature
         if (@substr($request_headers['Authorization'], 0, 6) == "OAuth ") {
             $header_parameters = OAuthRequest::split_header($request_headers['Authorization']);
             $parameters = array_merge($req_parameters, $header_parameters);
             $req = new OAuthRequest($http_method, $http_url, $parameters);
         } else {
             $req = new OAuthRequest($http_method, $http_url, $req_parameters);
         }
     }
     return $req;
 }
开发者ID:byjg,项目名称:xmlnuke,代码行数:34,代码来源:OAuthRequest.php

示例2: from_request

 /**
  * attempt to build up a request from what was passed to the server
  */
 public static function from_request($http_method = NULL, $http_url = NULL, $parameters = NULL)
 {
     /*{{{*/
     @$http_url or $http_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     @$http_method or $http_method = $_SERVER['REQUEST_METHOD'];
     $request_headers = OAuthRequest::get_headers();
     // let the library user override things however they'd like, if they know
     // which parameters to use then go for it, for example XMLRPC might want to
     // do this
     if ($parameters) {
         $req = new OAuthRequest($http_method, $http_url, $parameters);
     } else {
         if (@substr($request_headers['Authorization'], 0, 5) == "OAuth") {
             $header_parameters = OAuthRequest::split_header($request_headers['Authorization']);
             if ($http_method == "GET") {
                 $req_parameters = $_GET;
             } else {
                 if ($http_method = "POST") {
                     $req_parameters = $_POST;
                 }
             }
             $parameters = array_merge($header_parameters, $req_parameters);
             $req = new OAuthRequest($http_method, $http_url, $parameters);
         } else {
             if ($http_method == "GET") {
                 $req = new OAuthRequest($http_method, $http_url, $_GET);
             } else {
                 if ($http_method == "POST") {
                     $req = new OAuthRequest($http_method, $http_url, $_POST);
                 }
             }
         }
     }
     return $req;
 }
开发者ID:habari-extras,项目名称:fireeagle,代码行数:38,代码来源:OAuth.php

示例3: from_request

	/**
	 * attempt to build up a request from what was passed to the server
	 */
	public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
		@$http_url or $http_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
		@$http_method or $http_method = $_SERVER['REQUEST_METHOD'];

		$request_headers = OAuthRequest::get_headers();

		// let the library user override things however they'd like, if they know
		// which parameters to use then go for it, for example XMLRPC might want to
		// do this
		if ($parameters) {
			$req = new OAuthRequest($http_method, $http_url, $parameters);
		}
		// next check for the auth header, we need to do some extra stuff
		// if that is the case, namely suck in the parameters from GET or POST
		// so that we can include them in the signature
		else if (@substr($request_headers['Authorization'], 0, 5) == "OAuth") {
			$header_parameters = OAuthRequest::split_header($request_headers['Authorization']);
			if ($http_method == "GET") {
				$req_parameters = $_GET;
			}
			else if ($http_method = "POST") {
				$req_parameters = $_POST;
			}
			$parameters = array_merge($header_parameters, $req_parameters);
			$req = new OAuthRequest($http_method, $http_url, $parameters);
		}
		else if ($http_method == "GET") {
			$req = new OAuthRequest($http_method, $http_url, $_GET);
		}
		else if ($http_method == "POST") {
			$req = new OAuthRequest($http_method, $http_url, $_POST);
		}
		return $req;
	}
开发者ID:hoalangoc,项目名称:ftf,代码行数:37,代码来源:OAuth.php

示例4: from_request

 /**
  * attempt to build up a request from what was passed to the server
  */
 public static function from_request($http_method = NULL, $http_url = NULL, $parameters = NULL)
 {
     /*{{{*/
     $scheme = !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on" ? 'http' : 'https';
     @$http_url or $http_url = $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     @$http_method or $http_method = $_SERVER['REQUEST_METHOD'];
     $request_headers = OAuthRequest::get_headers();
     // let the library user override things however they'd like, if they know
     // which parameters to use then go for it, for example XMLRPC might want to
     // do this
     if ($parameters) {
         $req = new OAuthRequest($http_method, $http_url, $parameters);
     } else {
         if (@substr($request_headers['Authorization'], 0, 5) == "OAuth") {
             $header_parameters = OAuthRequest::split_header($request_headers['Authorization']);
             if ($http_method == "GET") {
                 $req_parameters = $_GET;
             } else {
                 if ($http_method == "POST") {
                     $req_parameters = $_POST;
                 }
             }
             $parameters = array_merge($header_parameters, $req_parameters);
             $req = new OAuthRequest($http_method, $http_url, $parameters);
         } else {
             if ($http_method == "GET") {
                 $req = new OAuthRequest($http_method, $http_url, $_GET);
             } else {
                 if ($http_method == "POST" && $_SERVER['CONTENT_TYPE'] == 'text/xml') {
                     // XML-RPC
                     $req = new OAuthRequest($http_method, $http_url, $_GET);
                     //XXX until there's xoauth_body_signature
                 } else {
                     if ($http_method == "POST") {
                         $req = new OAuthRequest($http_method, $http_url, $_POST);
                     }
                 }
             }
         }
     }
     return $req;
 }
开发者ID:x42,项目名称:dokuoauth,代码行数:45,代码来源:OAuth.php


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