Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #28 from IT-Can/master

class name fixes + instagram fix
  • Loading branch information...
commit f0c8dfdf4de9241d58cc6685dfd59cf01e10c77c 2 parents 1543d48 + df14d62
Phil Sturgeon authored
14 libraries/OAuth2.php
View
@@ -1,5 +1,5 @@
<?php
-
+
include('Exception.php');
include('Token.php');
include('Provider.php');
@@ -10,7 +10,7 @@
* @author Phil Sturgeon < @philsturgeon >
*/
class OAuth2 {
-
+
/**
* Create a new provider.
*
@@ -23,11 +23,13 @@ class OAuth2 {
*/
public static function provider($name, array $options = NULL)
{
- include_once 'Provider/'.ucfirst($name).'.php';
-
- $class = 'OAuth2_Provider_'.ucfirst($name);
+ $name = ucfirst(strtolower($name));
+
+ include_once 'Provider/'.$name.'.php';
+
+ $class = 'OAuth2_Provider_'.$name;
return new $class($options);
}
-
+
}
2  libraries/Provider/Instagram.php
View
@@ -9,7 +9,7 @@
* @license http://philsturgeon.co.uk/code/dbad-license
*/
-class OAuth_Provider_Instagram extends OAuth2_Provider
+class OAuth2_Provider_Instagram extends OAuth2_Provider
{
/**
* @var string scope separator, most use "," but some like Google are spaces
12 libraries/Token.php
View
@@ -21,10 +21,12 @@
*/
public static function factory($name = 'access', array $options = null)
{
- include_once 'Token/'.ucfirst($name).'.php';
-
- $class = 'OAuth2_Token_'.ucfirst($name);
-
+ $name = ucfirst(strtolower($name));
+
+ include_once 'Token/'.$name.'.php';
+
+ $class = 'OAuth2_Token_'.$name;
+
return new $class($options);
}
@@ -41,7 +43,7 @@ public function __get($key)
{
return $this->$key;
}
-
+
/**
* Return a boolean if the property is set
*
Please sign in to comment.
Something went wrong with that request. Please try again.