當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth::setPassword方法代碼示例

本文整理匯總了PHP中app\Auth::setPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::setPassword方法的具體用法?PHP Auth::setPassword怎麽用?PHP Auth::setPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Auth的用法示例。


在下文中一共展示了Auth::setPassword方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: parseInput

 private function parseInput(InputInterface $input, OutputInterface $output)
 {
     /** @var QuestionHelper $helper */
     $helper = $this->getHelper('question');
     /*
      * Filename
      */
     $this->filename = $input->getOption('filename');
     if (empty($this->filename)) {
         $this->filename = $helper->ask($input, $output, new Question('Json file to import: '));
     }
     if (!file_exists($this->filename)) {
         throw new \Exception('File not found');
     }
     /*
      * Owner
      */
     $this->owner = $input->getOption('owner');
     if (empty($this->owner)) {
         $this->owner = $helper->ask($input, $output, new Question('Owner of GitHub repository, organization or a person: '));
     }
     if (empty($this->owner)) {
         throw new \Exception('Empty owner');
     }
     /*
      * Repo
      */
     $this->repo = $input->getOption('repo');
     if (empty($this->repo)) {
         $this->repo = $helper->ask($input, $output, new Question('GitHub repository name: '));
     }
     if (empty($this->repo)) {
         throw new \Exception('Empty repo');
     }
     /*
      * username
      */
     $username = $input->getOption('username');
     if (empty($username)) {
         $username = $helper->ask($input, $output, new Question('GitHub username to log in with: '));
     }
     if (empty($username)) {
         throw new \Exception('Empty username');
     }
     $this->auth = new Auth($username);
     if ($helper->ask($input, $output, new Question('Do you use 2 factor auth for GitHub? (y/N) '))) {
         $question = new Question('GitHub personal token (https://github.com/settings/tokens) with repo access: ');
         $token = $helper->ask($input, $output, $question);
         $this->auth->setToken($token);
     } else {
         $password = $helper->ask($input, $output, new Question('GitHub password: '));
         $this->auth->setPassword($password);
     }
 }
開發者ID:hmazter,項目名稱:bitbucket-json-to-github-issues,代碼行數:54,代碼來源:ImportCommand.php


注:本文中的app\Auth::setPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。