Beispiel #1
0
 private function sourceChecksum($source)
 {
     $Application = new \Gumdrop\Application();
     $Application->setFileHandler(new \Gumdrop\FileHandler($Application));
     $Application->setSourceLocation($source);
     return $Application->getFileHandler()->getSourceFolderHash();
 }
Beispiel #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $source = $input->getArgument('source');
     $destination = $input->getArgument('destination');
     $Application = new \Gumdrop\Application();
     $Application->setSourceLocation($source);
     $Application->setDestinationLocation($destination);
     $Application->setMarkdownParser(new \dflydev\markdown\MarkdownExtraParser());
     $Application->setTwigEnvironments(new \Gumdrop\TwigEnvironments($Application));
     $Application->setFileHandler(new \Gumdrop\FileHandler($Application));
     $Application->setTwigFileHandler(new \Gumdrop\TwigFileHandler($Application));
     $Application->setEngine(new \Gumdrop\Engine($Application));
     try {
         $Application->getEngine()->run();
         $output->writeln('<fg=green>Gumdrop converted your MarkDown files to ' . realpath($Application->getDestinationLocation()) . '</fg=green>');
     } catch (\Exception $e) {
         $output->writeln('<fg=red>Gumdrop could not generate your site for the following reason:</fg=red>');
         $output->writeln('<fg=black;bg=red>' . $e->getMessage() . '</fg=black;bg=red>');
     }
 }