Exemplo n.º 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('<info>Setting up default OAuth scopes...</info>');
     $oAuthService = new OAuthService($this->getSlim());
     foreach ($this->getSlim()->config('xAPI')['supported_auth_scopes'] as $authScope) {
         $scope = $oAuthService->addScope($authScope['name'], $authScope['description']);
     }
     $output->writeln('<info>OAuth scopes configured!</info>');
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $oAuthService = new OAuthService($this->getSlim());
     $helper = $this->getHelper('question');
     $question = new Question('Please enter a name (scope identifier): ', 'untitled');
     $name = $helper->ask($input, $output, $question);
     $question = new Question('Please enter a description: ', '');
     $description = $helper->ask($input, $output, $question);
     $scope = $oAuthService->addScope($name, $description);
     $text = json_encode($scope, JSON_PRETTY_PRINT);
     $output->writeln('<info>Auth scope successfully created!</info>');
     $output->writeln('<info>Info:</info>');
     $output->writeln($text);
 }