$config = new Config();
$config->setProvider(Factory::PROVIDER_GOOGLE);
$config->setAuthToken($_GET["code"]);
$manager = Factory::create($config);
$manager->addListener(function ($event, $value) {
if ($event === Manager::EVENT_ACCESS_TOKEN) {
/** @var AccessToken $accessToken */
$_SESSION["accessToken"]= $value;
// Persist the access token in session storage, cache or whatever.
// The persisted access token should be passed to the Authentication factory for authentication
}
});
// Initialize the pokemon go application
$application = new ApplicationKernel($manager);
But I had got the error:
[error] 28915#0: *631 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'DI\NotFoundException' with message 'No entry or class found for 'config'' in /usr/share/nginx/html/poke/vendor/php-di/php-di/src/DI/Container.php:119
Please help me to check it.
My source code as:
But I had got the error:
[error] 28915#0: *631 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'DI\NotFoundException' with message 'No entry or class found for 'config'' in /usr/share/nginx/html/poke/vendor/php-di/php-di/src/DI/Container.php:119
Please help me to check it.