Ejemplo n.º 1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('<info>Generating packages!</info>');
     $config = $this->getConfig($input, $output);
     if (!$config) {
         return;
     }
     $configNormalizer = new Normalizer();
     $config = $configNormalizer->normalize($config);
     $optimizer = new Optimizer($config);
     $packageNames = array_keys($config['packages']);
     if (count($packageNames)) {
         $output->writeln('<info>Generating packages...</info>');
         try {
             $optimizer->optimizePackages();
         } catch (\Exception $e) {
             $output->writeln('<error>' . $e->getMessage() . '</error>');
             return;
         }
         foreach ($packageNames as $packageName) {
             $output->writeln('<info>' . $packageName . '</info>');
         }
         $output->writeln('<info>Packages generated succesfully!</info>');
     } else {
         $output->writeln('<info>No packages configured</info>');
     }
 }
Ejemplo n.º 2
0
 public function setConfig($config)
 {
     $normalizer = new Normalizer();
     $this->config = $normalizer->normalize($config);
 }