mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Test if provider config exists
This commit is contained in:
parent
ed6301a497
commit
17b7bf7d1d
@ -25,7 +25,17 @@ class Provider
|
|||||||
{
|
{
|
||||||
$name = ucfirst(strtolower($name));
|
$name = ucfirst(strtolower($name));
|
||||||
|
|
||||||
require_once 'Provider/'.$name.'.php';
|
$fileName = 'Provider/'.$name.'.php';
|
||||||
|
|
||||||
|
if (file_exists($fileName)) {
|
||||||
|
|
||||||
|
require_once $fileName;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
throw new Exception('There is no provider configuration file for '.$name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return new $name($options);
|
return new $name($options);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user