1 | <?php |
||
33 | class UnixPasswordRetrievalStrategy implements PasswordRetrievalStrategyInterface |
||
34 | { |
||
35 | |||
36 | /** |
||
37 | * @var OutputInterface |
||
38 | */ |
||
39 | protected $output; |
||
40 | |||
41 | /** |
||
42 | * @var ConfigurationInterface |
||
43 | */ |
||
44 | protected $configuration; |
||
45 | |||
46 | /** |
||
47 | * MacOsPasswordRetrievalStrategy constructor. |
||
48 | * |
||
49 | * @param OutputInterface $output |
||
50 | * @param ConfigurationInterface $configuration |
||
51 | */ |
||
52 | public function __construct(OutputInterface $output, ConfigurationInterface $configuration) |
||
57 | |||
58 | /** |
||
59 | * Prompt silent |
||
60 | * |
||
61 | * Interactively prompts for input without echoing to the terminal. |
||
62 | * Requires a bash shell or Windows and won't work with |
||
63 | * safe_mode settings (Uses `shell_exec`) |
||
64 | * |
||
65 | * Source: http://www.sitepoint.com/interactive-cli-password-prompt-in-php/ |
||
66 | * |
||
67 | * @param OutputInterface $output Console output interface |
||
68 | * @param string $prompt The message to the user |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function promptSilent(OutputInterface $output, $prompt = "Enter Password:") |
||
86 | |||
87 | /** |
||
88 | * Will retrieve a stored password from the OSX keychain |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getPassword() |
||
102 | } |
||
103 |