Пример #1
0
 public function showAuthorizations(GithubService $api, AccessResponse $accessResponse)
 {
     try {
         echo "<p>This function is likely to fail. It appears that Github do not support it through the api with bearer tokens.</p>";
         //$api = new GithubAPI(GITHUB_USER_AGENT);
         $authCommand = $api->getAuthorizations(new Oauth2Token($accessResponse->accessToken));
         $authorisations = $authCommand->execute();
         foreach ($authorisations->getIterator() as $authorisation) {
             echo "Application: " . $authorisation->application . "<br/>";
             echo "Scopes:" . implode($authorisation->scopes) . "<br/>";
             echo "<br/>";
         }
     } catch (\GithubService\GithubArtaxService\GithubArtaxServiceException $gae) {
         echo "<p>Error in showAuthorizations: ";
         echo $gae->getMessage();
         echo "</p>";
     }
 }