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


PHP OAuthRequest::generate_timestamp方法代码示例

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


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

示例1: from_consumer_and_token

 /**
  * pretty much a helper function to set up the request
  */
 public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL)
 {
     $parameters = $parameters ? $parameters : array();
     $defaults = array("oauth_version" => OAuthRequest::$version, "oauth_nonce" => OAuthRequest::generate_nonce(), "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     if ($token) {
         $defaults['oauth_token'] = $token->key;
     }
     $parameters = array_merge($defaults, $parameters);
     return new OAuthRequest($http_method, $http_url, $parameters);
 }
开发者ID:kenyonjohnston,项目名称:hott_theater,代码行数:13,代码来源:OAuthRequest.php

示例2: from_consumer_and_token

 /**
  * pretty much a helper function to set up the request
  */
 public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL)
 {
     @$parameters or $parameters = array();
     $defaults = array("oauth_version" => OAuthRequest::$version, "oauth_nonce" => OAuthRequest::generate_nonce(), "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     if ($token) {
         $defaults['oauth_token'] = $token->key;
     }
     $parameters = array_merge($defaults, $parameters);
     // Parse the query-string to find and add GET parameters
     $parts = parse_url($http_url);
     if (isset($parts['query'])) {
         $qparms = OAuthUtil::parse_parameters($parts['query']);
         $parameters = array_merge($qparms, $parameters);
     }
     return new OAuthRequest($http_method, $http_url, $parameters);
 }
开发者ID:csev,项目名称:tsugi-php,代码行数:19,代码来源:OAuthRequest.php

示例3: array

 /**
  * pretty much a helper function to set up the request
  * @access	public
  */
 function &from_consumer_and_token(&$consumer, $token, $http_method, $http_url, $parameters = NULL)
 {
     //$OAuthRequest = new OAuthRequest($http_method, $http_url);
     @$parameters or $parameters = array();
     $defaults = array("oauth_version" => '1.0', "oauth_nonce" => OAuthRequest::generate_nonce(), "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     if ($token) {
         $defaults['oauth_token'] = $token->key;
     }
     $parameters = array_merge($defaults, $parameters);
     $OAuthRequest = new OAuthRequest($http_method, $http_url, $parameters);
     return $OAuthRequest;
 }
开发者ID:nojimage,项目名称:basercms,代码行数:16,代码来源:OAuth.php

示例4: from_consumer_and_token

 /**
  * pretty much a helper function to set up the request
  */
 function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = array())
 {
     /*{{{*/
     static $version = '1.0';
     $defaults = array("oauth_version" => $version, "oauth_nonce" => OAuthRequest::generate_nonce(), "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     $parameters = array_merge($defaults, $parameters);
     if ($token) {
         $parameters['oauth_token'] = $token->key;
     }
     $req = new OAuthRequest($http_method, $http_url, $parameters);
     return $req;
 }
开发者ID:hagnismos,项目名称:yos-social-php,代码行数:15,代码来源:OAuth.php

示例5: from_consumer_and_token

 /**
  * pretty much a helper function to set up the request
  */
 public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL)
 {
     /*{{{*/
     @$parameters or $parameters = array();
     $defaults = array("oauth_version" => OAuthRequest::$version, "oauth_nonce" => OAuthRequest::generate_nonce(), "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     $parameters = array_merge($defaults, $parameters);
     if ($token) {
         $parameters['oauth_token'] = $token->key;
     }
     // oauth v1.0a
     /*if (isset($_REQUEST['oauth_verifier'])) {
         $parameters['oauth_verifier'] = $_REQUEST['oauth_verifier'];
       }*/
     return new OAuthRequest($http_method, $http_url, $parameters);
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:18,代码来源:OAuth.php

示例6: from_consumer_and_token

    /**
     * pretty much a helper function to set up the request
     */
    public static function from_consumer_and_token ($consumer, $token, $http_method, $http_url, $parameters=null) {
        if (is_null ($parameters)) {
            $parameters = array();
        }
        $defaults = array (
            'oauth_version'         => OAuthRequest::$version,
            'oauth_nonce'           => OAuthRequest::generate_nonce (),
            'oauth_timestamp'       => OAuthRequest::generate_timestamp (),
            'oauth_consumer_key'    => $consumer->key
        );
        if ($token) {
            $defaults['oauth_token'] = $token->key;
        }

        $parameters = array_merge ($defaults, $parameters);

        return new OAuthRequest ($http_method, $http_url, $parameters);
    }
开发者ID:niieani,项目名称:nandu,代码行数:21,代码来源:OAuth.php

示例7: request

 function request($url, $extra = array(), $force_post = false)
 {
     $oauth = array('oauth_version' => OAuthRequest::$version, 'oauth_nonce' => OAuthRequest::generate_nonce(), 'oauth_timestamp' => OAuthRequest::generate_timestamp(), 'oauth_consumer_key' => $this->consumer->key, 'oauth_token' => $this->access_token->key, 'oauth_signature_method' => $this->oa_method->get_name());
     if (isset($extra['post'])) {
         $params = $extra['post'];
     } elseif (isset($extra['get'])) {
         $params = $extra['get'];
     } else {
         $params = array();
     }
     if (isset($extra['post']) || $force_post) {
         $method = 'POST';
     } else {
         $method = 'GET';
     }
     $params = array_merge($params, $oauth);
     $request = new OAuthRequest($method, $url, $params);
     $params['oauth_signature'] = $request->build_signature($this->oa_method, $this->consumer, $this->access_token);
     $extra[strtolower($method)] = $params;
     return parent::request($url, $extra, $force_post);
 }
开发者ID:Besoftovac,项目名称:php-rest-api,代码行数:21,代码来源:class.restapi.php

示例8: from_consumer_and_token

 /**
  * pretty much a helper function to set up the request
  */
 function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters = NULL)
 {
     @$parameters or $parameters = array();
     $defaults = array("source" => $consumer->key, "oauth_version" => $GLOBALS['__CLASS']['OAuthRequest']['__STATIC']['OAuthRequest_version'], "oauth_nonce" => OAuthRequest::generate_nonce(), "oauth_timestamp" => OAuthRequest::generate_timestamp(), "oauth_consumer_key" => $consumer->key);
     if ($token) {
         $defaults['oauth_token'] = $token->key;
     }
     $parameters = array_merge($defaults, $parameters);
     return new OAuthRequest($http_method, $http_url, $parameters);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:13,代码来源:oauth.class.php

示例9: __build_oauth_header

 private function __build_oauth_header($linkedin_url)
 {
     $request = new OAuthRequest('GET', $linkedin_url, array('oauth_nonce' => OAuthRequest::generate_nonce(), 'oauth_timestamp' => OAuthRequest::generate_timestamp(), 'oauth_version' => '1.0', 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_consumer_key' => $this->oaConsumerKey, 'oauth_token' => OAUTH_USER_TOKEN));
     $request->sign_request($this->signature, new OAuthConsumer('', $this->oaConsumerSecret), new OAuthToken('', '95b27494-0a99-47c0-a66c-533cef4b8a28'));
     return $request->to_header();
 }
开发者ID:manoj-samosys,项目名称:linkedin-api-quick-start-php,代码行数:6,代码来源:linkedin.php


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