File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed
Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 11<?php
2-
2+
33include ('Exception.php ' );
44include ('Token.php ' );
55include ('Provider.php ' );
1010 * @author Phil Sturgeon < @philsturgeon >
1111 */
1212class OAuth2 {
13-
13+
1414 /**
1515 * Create a new provider.
1616 *
@@ -23,11 +23,13 @@ class OAuth2 {
2323 */
2424 public static function provider ($ name , array $ options = NULL )
2525 {
26- include_once 'Provider/ ' .ucfirst ($ name ).'.php ' ;
27-
28- $ class = 'OAuth2_Provider_ ' .ucfirst ($ name );
26+ $ name = ucfirst (strtolower ($ name ));
27+
28+ include_once 'Provider/ ' .$ name .'.php ' ;
29+
30+ $ class = 'OAuth2_Provider_ ' .$ name ;
2931
3032 return new $ class ($ options );
3133 }
32-
34+
3335}
Original file line number Diff line number Diff line change 99 * @license http://philsturgeon.co.uk/code/dbad-license
1010 */
1111
12- class OAuth_Provider_Instagram extends OAuth2_Provider
12+ class OAuth2_Provider_Instagram extends OAuth2_Provider
1313{
1414 /**
1515 * @var string scope separator, most use "," but some like Google are spaces
Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ abstract class OAuth2_Token {
2121 */
2222 public static function factory ($ name = 'access ' , array $ options = null )
2323 {
24- include_once 'Token/ ' .ucfirst ($ name ).'.php ' ;
25-
26- $ class = 'OAuth2_Token_ ' .ucfirst ($ name );
27-
24+ $ name = ucfirst (strtolower ($ name ));
25+
26+ include_once 'Token/ ' .$ name .'.php ' ;
27+
28+ $ class = 'OAuth2_Token_ ' .$ name ;
29+
2830 return new $ class ($ options );
2931 }
3032
@@ -41,7 +43,7 @@ public function __get($key)
4143 {
4244 return $ this ->$ key ;
4345 }
44-
46+
4547 /**
4648 * Return a boolean if the property is set
4749 *
You can’t perform that action at this time.
0 commit comments