web/lib/Zend/Oauth/Http.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: Http.php 22662 2010-07-24 17:37:36Z mabe $
    19  * @version    $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $
    20  */
    20  */
    21 
    21 
    22 /** Zend_Oauth_Http_Utility */
    22 /** Zend_Oauth_Http_Utility */
    23 require_once 'Zend/Oauth/Http/Utility.php';
    23 require_once 'Zend/Oauth/Http/Utility.php';
    24 
    24 
    26 require_once 'Zend/Uri/Http.php';
    26 require_once 'Zend/Uri/Http.php';
    27 
    27 
    28 /**
    28 /**
    29  * @category   Zend
    29  * @category   Zend
    30  * @package    Zend_Oauth
    30  * @package    Zend_Oauth
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    31  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  */
    33  */
    34 class Zend_Oauth_Http
    34 class Zend_Oauth_Http
    35 {
    35 {
    36     /**
    36     /**
    78      * @param  null|array $parameters
    78      * @param  null|array $parameters
    79      * @param  null|Zend_Oauth_Http_Utility $utility
    79      * @param  null|Zend_Oauth_Http_Utility $utility
    80      * @return void
    80      * @return void
    81      */
    81      */
    82     public function __construct(
    82     public function __construct(
    83         Zend_Oauth_Consumer $consumer, 
    83         Zend_Oauth_Consumer $consumer,
    84         array $parameters = null,
    84         array $parameters = null,
    85         Zend_Oauth_Http_Utility $utility = null
    85         Zend_Oauth_Http_Utility $utility = null
    86     ) {
    86     ) {
    87         $this->_consumer = $consumer;
    87         $this->_consumer = $consumer;
    88         $this->_preferredRequestScheme = $this->_consumer->getRequestScheme();
    88         $this->_preferredRequestScheme = $this->_consumer->getRequestScheme();
   231                 break;
   231                 break;
   232             default:
   232             default:
   233                 require_once 'Zend/Oauth/Exception.php';
   233                 require_once 'Zend/Oauth/Exception.php';
   234                 throw new Zend_Oauth_Exception(
   234                 throw new Zend_Oauth_Exception(
   235                     'Could not retrieve a valid Token response from Token URL:'
   235                     'Could not retrieve a valid Token response from Token URL:'
   236                     . ($response !== null 
   236                     . ($response !== null
   237                         ? PHP_EOL . $response->getBody()
   237                         ? PHP_EOL . $response->getBody()
   238                         : ' No body - check for headers')
   238                         : ' No body - check for headers')
   239                 );
   239                 );
   240         }
   240         }
   241     }
   241     }