Example #1
0
 /**
  * Guess magento edition and version
  *
  * @param string $url
  *
  * @return array|boolean
  */
 public function getInfo($url)
 {
     $checker = new Check($url);
     $info = $checker->getInfo();
     if ($info === false) {
         return false;
     }
     $edition = key($info);
     $versions = $info[$edition];
     return [$edition, implode(', ', $versions)];
 }
Example #2
0
 /**
  * Guess magento edition and version
  *
  * @return array|boolean
  */
 public function getInfo()
 {
     $checker = new Check($this->getRequest()->getUrl());
     $info = $checker->getInfo();
     if ($info === false) {
         return false;
     }
     $edition = key($info);
     $versions = $info[$edition];
     return [$edition, implode(', ', $versions)];
 }
 /**
  * Run check command
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return void
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $checker = new Check($input->getArgument('url'));
     $info = $checker->getInfo();
     if ($info === false) {
         $output->writeln('<error>Unable to retrieve Magento information</error>');
         return;
     }
     $i = 0;
     foreach ($info as $edition => $versions) {
         $output->writeln(sprintf('Edition: <info>%s</info>', $edition));
         $output->writeln(sprintf('Version: <info>%s</info>', implode(', ', $versions)));
         if ($i++ > 0) {
             $output->writeln('OR');
         }
     }
 }