Esempio n. 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $oldRoot = $this->util->getKeyStorageRoot();
     $newRoot = $input->getArgument('newRoot');
     if ($newRoot === null) {
         $question = new ConfirmationQuestion('No storage root given, do you want to reset the key storage root to the default location? (y/n) ', false);
         if (!$this->questionHelper->ask($input, $output, $question)) {
             return;
         }
         $newRoot = '';
     }
     $oldRootDescription = $oldRoot !== '' ? $oldRoot : 'default storage location';
     $newRootDescription = $newRoot !== '' ? $newRoot : 'default storage location';
     $output->writeln("Change key storage root from <info>{$oldRootDescription}</info> to <info>{$newRootDescription}</info>");
     $success = $this->moveAllKeys($oldRoot, $newRoot, $output);
     if ($success) {
         $this->util->setKeyStorageRoot($newRoot);
         $output->writeln('');
         $output->writeln("Key storage root successfully changed to <info>{$newRootDescription}</info>");
     }
 }