Trying to figure out how to instantiate class with name spaces. The library was built for Composer to manage dependencies, but we're using just the necessary classes for our project.
We are using this library:
https://github.com/thephpleague/oauth2-client
We have included the /src directory and are attempting to instantiate a class using namespaces as required by the library.
foreach (glob('src/*.php') as $filename)
{
include_once $filename;
}
$provider = new \League\OAuth2\Client\Provider\GenericProvider([
'clientId' => $client_id, // The client ID assigned to you by the provider
'clientSecret' => $client_secret, // The client password assigned to you by the provider
'redirectUri' => 'http://example.com/your-redirect-url/',
'urlAuthorize' => 'https://example.com/oauth2/auth',
'urlAccessToken' => 'https://example.com/oauth2/token',
'urlResourceOwnerDetails' => 'https://example.com/oauth2/token'
]);
2 Answer(s)