From 6dbebff877a210a3fc16a27f7b4c229796878d9d Mon Sep 17 00:00:00 2001 From: dvogel Date: Thu, 5 May 2022 09:22:05 +0200 Subject: [PATCH 1/2] Add IUserInteraction interface --- src/IUserInteraction.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/IUserInteraction.php diff --git a/src/IUserInteraction.php b/src/IUserInteraction.php new file mode 100644 index 0000000..51a246b --- /dev/null +++ b/src/IUserInteraction.php @@ -0,0 +1,28 @@ + Date: Wed, 18 May 2022 10:45:33 +0200 Subject: [PATCH 2/2] User UserInteraction for command analyzer --- src/Command/Analyze.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Command/Analyze.php b/src/Command/Analyze.php index 7d5b15a..a02402f 100644 --- a/src/Command/Analyze.php +++ b/src/Command/Analyze.php @@ -7,6 +7,7 @@ use HalloWelt\MediaWiki\Lib\Migration\DataBuckets; use HalloWelt\MediaWiki\Lib\Migration\IAnalyzer; use HalloWelt\MediaWiki\Lib\Migration\IOutputAwareInterface; +use HalloWelt\MediaWiki\Lib\Migration\IUserInteraction; class Analyze extends CliCommandBase { @@ -56,6 +57,11 @@ protected function doProcessFile(): bool { if ( $analyzer instanceof IOutputAwareInterface ) { $analyzer->setOutput( $this->output ); } + if ( $analyzer instanceof IUserInteraction ) { + $analyzer->setQuestionHelper( $this->getHelper( 'question' ) ); + $analyzer->setOutput( $this->output ); + $analyzer->setInput( $this->input ); + } $result = $analyzer->analyze( $this->currentFile ); // TODO: Evaluate result }