當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。