Permalink
Browse files

Didn't presume config to be an array, allows users to use Zend_Config…

… object.
  • Loading branch information...
1 parent 74cf444 commit 45749b0c65173999b06a9916b92ce90bc21398ab @manticorp manticorp committed Jun 26, 2013
Showing with 13 additions and 6 deletions.
  1. +5 −2 Auth/Adapter/Facebook.php
  2. +4 −2 Auth/Adapter/Google.php
  3. +4 −2 Auth/Adapter/Twitter.php
@@ -36,7 +36,8 @@ public function authenticate()
public static function getAuthorizationUrl()
{
- $options = Registry::get('config');
+ $config = Registry::get('config');
+ $options = is_object($config) ? $config->toArray() : $config;
return Consumer::getAuthorizationUrl($options['facebook']);
}
@@ -59,7 +60,9 @@ public function setAccessToken($token) {
protected function _setOptions($options = null)
{
- $options = Registry::get('config');
+
+ $config = Registry::get('config');
+ $options = is_object($config) ? $config->toArray() : $config;
$this->_options = $options['facebook'];
}
}
@@ -38,7 +38,8 @@ public function authenticate()
public static function getAuthorizationUrl()
{
- $options = Registry::get('config');
+ $config = Registry::get('config');
+ $options = is_object($config) ? $config->toArray() : $config;
return Consumer::getAuthorizationUrl($options['google']);
}
@@ -54,7 +55,8 @@ protected function _setRequestToken($requestToken)
protected function _setOptions($options = null)
{
- $options = Registry::get('config');
+ $config = Registry::get('config');
+ $options = is_object($config) ? $config->toArray() : $config;
$this->_options = $options['google'];
}
}
@@ -41,7 +41,8 @@ public function authenticate()
public static function getAuthorizationUrl()
{
- $options = Registry::get('config');
+ $config = Registry::get('config');
+ $options = is_object($config) ? $config->toArray() : $config;
$consumer = new Consumer($options['twitter']);
$token = $consumer->getRequestToken();
$twitterToken = new SessionNamespace('twitterToken');
@@ -51,7 +52,8 @@ public static function getAuthorizationUrl()
protected function _setOptions($options = null)
{
- $options = Registry::get('config');
+ $config = Registry::get('config');
+ $options = is_object($config) ? $config->toArray() : $config;
$this->_options = $options['twitter'];
}

0 comments on commit 45749b0

Please sign in to comment.