Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLEANUP] Streamline installation process #159

Merged
merged 2 commits into from
Apr 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 25 additions & 11 deletions Classes/Install/CliSetupRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ protected function dispatchAction($actionName)
$this->output->outputLine(sprintf('%s:', $command->getShortDescription()));

$actionArguments = array();
/** @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandArgumentDefinition $argumentDefinition */
foreach ($command->getArgumentDefinitions() as $argumentDefinition) {
$isPasswordArgument = strpos(strtolower($argumentDefinition->getName()), 'password') !== false;
$argument = $arguments->getArgument($argumentDefinition->getName());
if (isset($this->givenRequestArguments[$argumentDefinition->getName()])) {
$actionArguments[$argumentDefinition->getName()] = $this->givenRequestArguments[$argumentDefinition->getName()];
Expand All @@ -199,13 +201,23 @@ protected function dispatchAction($actionName)
}
$argumentValue = null;
do {
$argumentValue = $this->output->ask(
sprintf(
'<comment>%s (%s):</comment> ',
$argumentDefinition->getDescription(),
$argument->isRequired() ? 'required' : sprintf('default: "%s"', $argument->getDefaultValue())
)
);
if ($isPasswordArgument) {
$argumentValue = $this->output->askHiddenResponse(
sprintf(
'<comment>%s (%s):</comment> ',
$argumentDefinition->getDescription(),
$argument->isRequired() ? 'required' : sprintf('default: "%s"', $argument->getDefaultValue())
)
);
} else {
$argumentValue = $this->output->ask(
sprintf(
'<comment>%s (%s):</comment> ',
$argumentDefinition->getDescription(),
$argument->isRequired() ? 'required' : sprintf('default: "%s"', $argument->getDefaultValue())
)
);
}
} while ($argumentDefinition->isRequired() && $argumentValue === null);
$actionArguments[$argumentDefinition->getName()] = $argumentValue !== null ? $argumentValue : $argument->getDefaultValue();
}
Expand Down Expand Up @@ -290,8 +302,7 @@ protected function executeSilentConfigurationUpgradesIfNeeded()
*/
protected function reloadConfiguration()
{
$configurationManger = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)->get(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class);
$configurationManger->exportConfiguration();
GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class)->exportConfiguration();
}

// Logging and output related stuff
Expand Down Expand Up @@ -321,11 +332,14 @@ protected function outputStatusMessage(StatusInterface $statusMessage)
$subject = strtoupper($statusMessage->getSeverity()) . ': ' . $statusMessage->getTitle();
switch ($statusMessage->getSeverity()) {
case 'error':
$subject = '<error>' . $subject . '</error>';
case 'warning':
$subject = sprintf('<%1$s>' . $subject . '</%1$s>', $statusMessage->getSeverity());
break;
default:
}
$this->output->outputLine($subject);
$this->output->outputLine(wordwrap($statusMessage->getMessage()));
foreach (explode("\n", wordwrap($statusMessage->getMessage())) as $line) {
$this->output->outputLine(sprintf('<%1$s>' . $line . '</%1$s>', $statusMessage->getSeverity()));
}
}
}