public function publish(Build $build) { $publishpath = $build->getBuildRoot() . '/' . (string) $this->getLanguage()->getName() . '/' . $this->getName(); if (!file_exists($publishpath)) { mkdir($publishpath, 0777, true); } $html = $this->getHtml(); $html = $this->wrapTemplate($html); $build->getLogger()->addWarning('Rendering into ' . $publishpath); file_put_contents($publishpath . "/index.html", $html); $wkhtmltopdfpath = $this->getWkHtmlToPdfPath(); $cmd = $wkhtmltopdfpath . ' ' . $publishpath . "/index.html" . ' ' . $publishpath . "/index.pdf"; exec($cmd); }
protected function execute(InputInterface $input, OutputInterface $output) { $filename = $input->getArgument('filename'); $buildroot = $input->getOption('buildroot'); echo "Processing '" . $filename . "'\n"; $build = new Build(); $logger = new Logger('buildcommand'); $logger->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG)); $build->setLogger($logger); $project = new Project(); if ($buildroot != '') { if ($buildroot[0] != '/') { $buildroot = getcwd() . '/' . $buildroot; } $build->setBuildRoot($buildroot); } $project->loadXmlFile($filename); $build->setProject($project); $build->build(); return; }