/**
  * Shows necessary information for installing Magento
  *
  * @return string
  * @throws \InvalidArgumentException
  */
 public function helpAction()
 {
     $type = $this->getRequest()->getParam('type');
     if ($type === false) {
         $usageInfo = $this->formatConsoleFullUsageInfo(array_merge(self::getConsoleUsage(), InitParamListener::getConsoleUsage()));
         return $usageInfo;
     }
     switch ($type) {
         case UserConfig::KEY_LANGUAGE:
             return $this->arrayToString($this->options->getLocaleList());
         case UserConfig::KEY_CURRENCY:
             return $this->arrayToString($this->options->getCurrencyList());
         case UserConfig::KEY_TIMEZONE:
             return $this->arrayToString($this->options->getTimezoneList());
         case self::HELP_LIST_OF_MODULES:
             return $this->getModuleListMsg();
         default:
             $usages = self::getCommandUsage();
             if (isset($usages[$type])) {
                 if ($usages[$type]) {
                     $formatted = $this->formatCliUsage($usages[$type]);
                     return "\nAvailable parameters:\n{$formatted}\n";
                 }
                 return "\nThis command has no parameters.\n";
             }
             throw new \InvalidArgumentException("Unknown type: {$type}");
     }
 }
예제 #2
0
 public function testGetCurrencyList()
 {
     $currencies = array_intersect($this->expectedCurrencies, array_keys($this->lists->getCurrencyList()));
     $this->assertEquals($this->expectedCurrencies, $currencies);
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     foreach ($this->lists->getCurrencyList() as $key => $currency) {
         $output->writeln($key . ' => ' . $currency);
     }
 }
 /**
  * @return ViewModel
  */
 public function indexAction()
 {
     $view = new ViewModel(['timezone' => $this->list->getTimezoneList(), 'currency' => $this->list->getCurrencyList(), 'language' => $this->list->getLocaleList(), 'isSampledataEnabled' => $this->sampleData->isDeployed()]);
     $view->setTerminal(true);
     return $view;
 }