web/lib/Zend/Oauth/Token/Access.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Oauth
    16  * @package    Zend_Oauth
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Access.php 20217 2010-01-12 16:01:57Z matthew $
    19  * @version    $Id: Access.php 24593 2012-01-05 20:35:02Z matthew $
    20  */
    20  */
    21 
    21 
    22 /** Zend_Oauth_Token */
    22 /** Zend_Oauth_Token */
    23 require_once 'Zend/Oauth/Token.php';
    23 require_once 'Zend/Oauth/Token.php';
    24 
    24 
    32 require_once 'Zend/Oauth/Client.php';
    32 require_once 'Zend/Oauth/Client.php';
    33 
    33 
    34 /**
    34 /**
    35  * @category   Zend
    35  * @category   Zend
    36  * @package    Zend_Oauth
    36  * @package    Zend_Oauth
    37  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    37  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    38  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    38  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    39  */
    39  */
    40 class Zend_Oauth_Token_Access extends Zend_Oauth_Token
    40 class Zend_Oauth_Token_Access extends Zend_Oauth_Token
    41 {
    41 {
    42     /**
    42     /**
    43      * Cast to HTTP header
    43      * Cast to HTTP header
    44      * 
    44      *
    45      * @param  string $url 
    45      * @param  string $url
    46      * @param  Zend_Oauth_Config_ConfigInterface $config 
    46      * @param  Zend_Oauth_Config_ConfigInterface $config
    47      * @param  null|array $customParams 
    47      * @param  null|array $customParams
    48      * @param  null|string $realm 
    48      * @param  null|string $realm
    49      * @return string
    49      * @return string
    50      */
    50      */
    51     public function toHeader(
    51     public function toHeader(
    52         $url, Zend_Oauth_Config_ConfigInterface $config, array $customParams = null, $realm = null
    52         $url, Zend_Oauth_Config_ConfigInterface $config, array $customParams = null, $realm = null
    53     ) {
    53     ) {
    61         return $this->_httpUtility->toAuthorizationHeader($params, $realm);
    61         return $this->_httpUtility->toAuthorizationHeader($params, $realm);
    62     }
    62     }
    63 
    63 
    64     /**
    64     /**
    65      * Cast to HTTP query string
    65      * Cast to HTTP query string
    66      * 
    66      *
    67      * @param  mixed $url 
    67      * @param  mixed $url
    68      * @param  Zend_Oauth_Config_ConfigInterface $config 
    68      * @param  Zend_Oauth_Config_ConfigInterface $config
    69      * @param  null|array $params 
    69      * @param  null|array $params
    70      * @return string
    70      * @return string
    71      */
    71      */
    72     public function toQueryString($url, Zend_Oauth_Config_ConfigInterface $config, array $params = null)
    72     public function toQueryString($url, Zend_Oauth_Config_ConfigInterface $config, array $params = null)
    73     {
    73     {
    74         if (!Zend_Uri::check($url)) {
    74         if (!Zend_Uri::check($url)) {
    81         return $this->_httpUtility->toEncodedQueryString($params);
    81         return $this->_httpUtility->toEncodedQueryString($params);
    82     }
    82     }
    83 
    83 
    84     /**
    84     /**
    85      * Get OAuth client
    85      * Get OAuth client
    86      * 
    86      *
    87      * @param  array $oauthOptions 
    87      * @param  array $oauthOptions
    88      * @param  null|string $uri 
    88      * @param  null|string $uri
    89      * @param  null|array|Zend_Config $config 
    89      * @param  null|array|Zend_Config $config
    90      * @param  bool $excludeCustomParamsFromHeader 
    90      * @param  bool $excludeCustomParamsFromHeader
    91      * @return Zend_Oauth_Client
    91      * @return Zend_Oauth_Client
    92      */
    92      */
    93     public function getHttpClient(array $oauthOptions, $uri = null, $config = null, $excludeCustomParamsFromHeader = true)
    93     public function getHttpClient(array $oauthOptions, $uri = null, $config = null, $excludeCustomParamsFromHeader = true)
    94     {
    94     {
    95         $client = new Zend_Oauth_Client($oauthOptions, $uri, $config, $excludeCustomParamsFromHeader);
    95         $client = new Zend_Oauth_Client($oauthOptions, $uri, $config, $excludeCustomParamsFromHeader);