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


PHP Zend_Oauth_Http_Utility::assembleParams方法代码示例

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


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

示例1: array

/**
 * Setup OAuth
 */
$options = array('requestScheme' => Zend_Oauth::REQUEST_SCHEME_HEADER, 'version' => '1.0', 'signatureMethod' => 'HMAC-SHA1', 'consumerKey' => $TWO_LEGGED_CONSUMER_KEY, 'consumerSecret' => $TWO_LEGGED_CONSUMER_SECRET_HMAC);
$config = new Zend_Oauth_Config();
$config->setOptions($options);
$config->setToken(new Zend_Oauth_Token_Access());
$config->setRequestMethod('GET');
$url = 'https://mail.google.com/mail/b/' . $TWO_LEGGED_EMAIL_ADDRESS . '/imap/';
$urlWithXoauth = $url . '?xoauth_requestor_id=' . urlencode($TWO_LEGGED_EMAIL_ADDRESS);
$httpUtility = new Zend_Oauth_Http_Utility();
/**
 * Get an unsorted array of oauth params,
 * including the signature based off those params.
 */
$params = $httpUtility->assembleParams($url, $config, array('xoauth_requestor_id' => $TWO_LEGGED_EMAIL_ADDRESS));
/**
 * Sort parameters based on their names, as required
 * by OAuth.
 */
ksort($params);
/**
 * Construct a comma-deliminated,ordered,quoted list of 
 * OAuth params as required by XOAUTH.
 * 
 * Example: oauth_param1="foo",oauth_param2="bar"
 */
$first = true;
$oauthParams = '';
foreach ($params as $key => $value) {
    // only include standard oauth params
开发者ID:manasaShivanna,项目名称:gmail-oauth2-tools,代码行数:31,代码来源:two-legged.php

示例2: unserialize

        exit;
    }
} else {
    // Retrieve mail using Access Token
    $accessToken = unserialize($_SESSION['ACCESS_TOKEN']);
    $config = new Zend_Oauth_Config();
    $config->setOptions($options);
    $config->setToken($accessToken);
    $config->setRequestMethod('GET');
    $url = 'https://mail.google.com/mail/b/' . $email_address . '/imap/';
    $httpUtility = new Zend_Oauth_Http_Utility();
    /**
     * Get an unsorted array of oauth params,
     * including the signature based off those params.
     */
    $params = $httpUtility->assembleParams($url, $config);
    /**
     * Sort parameters based on their names, as required
     * by OAuth.
     */
    ksort($params);
    /**
     * Construct a comma-deliminated,ordered,quoted list of 
     * OAuth params as required by XOAUTH.
     * 
     * Example: oauth_param1="foo",oauth_param2="bar"
     */
    $first = true;
    $oauthParams = '';
    foreach ($params as $key => $value) {
        // only include standard oauth params
开发者ID:manasaShivanna,项目名称:gmail-oauth2-tools,代码行数:31,代码来源:three-legged.php


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