本文整理汇总了PHP中OAuthRequest::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuthRequest::__construct方法的具体用法?PHP OAuthRequest::__construct怎么用?PHP OAuthRequest::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuthRequest
的用法示例。
在下文中一共展示了OAuthRequest::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* Construct the request to be verified
*
* @param string request
* @param string method
*/
function __construct($uri = null, $method = 'GET')
{
$this->store = elggconnect_get_oauth_store();
//OAuthStore::instance();
parent::__construct($uri, $method);
OAuthRequestLogger::start($this);
}
示例2: array
/**
* Construct the request to be verified
*
* @param string request
* @param string method
* @param array params The request parameters
*/
function __construct($uri = null, $method = null, $params = null)
{
if ($params) {
$encodedParams = array();
foreach ($params as $key => $value) {
if (preg_match("/^oauth_/", $key)) {
continue;
}
$encodedParams[rawurlencode($key)] = rawurlencode($value);
}
$this->param = array_merge($this->param, $encodedParams);
}
$this->store = OAuthStore::instance();
parent::__construct($uri, $method);
OAuthRequestLogger::start($this);
}
示例3: foreach
/**
* Construct the request to be signed. Parses or appends the parameters in the params url.
* When you supply an params array, then the params should not be urlencoded.
* When you supply a string, then it is assumed it is of the type application/x-www-form-urlencoded
*
* @param string request url
* @param string method PUT, GET, POST etc.
* @param mixed params string (for urlencoded data, or array with name/value pairs)
* @param string body optional body for PUT and/or POST requests
*/
function __construct($request, $method = 'GET', $params = null, $body = null)
{
$this->store = OAuthStore::instance();
if (is_string($params)) {
parent::__construct($request, $method, $params);
} else {
parent::__construct($request, $method);
if (is_array($params)) {
foreach ($params as $name => $value) {
$this->setParam($name, $value);
}
}
}
// With put/ post we might have a body (not for application/x-www-form-urlencoded requests)
if ($method == 'PUT' || $method == 'POST') {
$this->setBody($body);
}
}
示例4:
/**
* Construct the request to be verified
*
* @param string request
* @param string method
*/
function __construct($uri = null, $method = 'GET')
{
$this->store = OAuthStore::instance();
parent::__construct($uri, $method);
OAuthRequestLogger::start($this);
}
示例5:
/**
* Construct the request to be verified
*
* @param string request
* @param string method
* @param string postdata
*/
function __construct()
{
$this->store = OAuthStore::instance();
parent::__construct();
OAuthRequestLogger::start($this);
}