[Pkg-owncloud-commits] [owncloud] 15/153: Move password interaction to interact function

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 8a6dcdf4a47fb45d417ca1fd2aec2901c247d16f
Author: Bart Visscher <bartv at thisnet.nl>
Date:   Mon Feb 17 18:09:42 2014 +0100

    Move password interaction to interact function
---
 core/command/db/converttype.php | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php
index 370ace7..fb45ab3 100644
--- a/core/command/db/converttype.php
+++ b/core/command/db/converttype.php
@@ -29,6 +29,19 @@ class ConvertType extends Command {
 		parent::__construct();
 	}
 
+	protected function interact(InputInterface $input, OutputInterface $output) {
+		parent::interact($input, $output);
+		if (!$input->getOption('password')) {
+			$dialog = $this->getHelperSet()->get('dialog');
+			$password = $dialog->askHiddenResponse(
+				$output,
+				'What is the database password?',
+				false
+			);
+			$input->setOption('password', $password);
+		}
+	}
+
 	protected function configure() {
 		$this
 			->setName('db:convert-type')
@@ -137,22 +150,11 @@ class ConvertType extends Command {
 		$username = $input->getArgument('username');
 		$hostname = $input->getArgument('hostname');
 		$dbname = $input->getArgument('database');
+		$password = $input->getOption('password');
 
 		if (!isset(self::$type2driver[$type])) {
 			throw new InvalidArgumentException('Unknown type: '.$type);
 		}
-		if ($input->getOption('password')) {
-			$password = $input->getOption('password');
-		} else {
-			// TODO: should be moved to the interact function
-			$dialog = $this->getHelperSet()->get('dialog');
-			$password = $dialog->askHiddenResponse(
-				$output,
-				'What is the database password?',
-				false
-			);
-			$input->setOption('password', $password);
-		}
 		$connectionParams = array(
 				'driver' => self::$type2driver[$type],
 				'user' => $username,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list