Commit: 7d147672ca67f4f6f50c33e33d81c513ffaa6600

Author: gwoo | Date: 2009-11-30 14:23:21 -0800
fixign some errors adding a proxy config
diff --git a/extensions/service/Oauth.php b/extensions/service/Oauth.php index b512882..fa1c914 100644 --- a/extensions/service/Oauth.php +++ b/extensions/service/Oauth.php @@ -60,8 +60,12 @@ class Oauth extends \lithium\core\Object { */ public function _init() { parent::_init(); - $this->service = new $this->_classes['service']($this->_config); - $this->storage = new $this->_classes['storage']($this->_config); + $config = $this->_config; + if (!empty($config['proxy'])) { + $config['host'] = $config['proxy']; + } + $this->service = new $this->_classes['service']($config); + $this->storage = new $this->_classes['storage']($config); } /** @@ -134,12 +138,10 @@ class Oauth extends \lithium\core\Object { $options += $defaults; $params = $this->_build($options['params'] + (array)$options['token']) + $options['data']; $base = $this->_base($options['method'], $options['url'], $params); - $key = join("&", array( rawurlencode($options['oauth_consumer_secret']), rawurlencode($options['token']['oauth_token_secret']) )); - switch ($options['hash']) { case 'HMAC-SHA1': $signature = base64_encode(hash_hmac('sha1', $base, $key, true)); diff --git a/models/Consumer.php b/models/Consumer.php index da57c81..0243ec1 100644 --- a/models/Consumer.php +++ b/models/Consumer.php @@ -78,7 +78,7 @@ class Consumer extends \lithium\core\StaticObject { * @param array $data data to send as the body of the request * @return string */ - public static function post($url, $token, $data = array(), $params, $options = array()) { + public static function post($url, $token, $data = array(), $params = array(), $options = array()) { return static::$_service->send($url, $params + array( 'hash' => 'HMAC-SHA1', 'method' => 'POST', 'token' => (array) $token, 'data' => $data ), $options);