protected function execute(InputInterface $input, OutputInterface $output) { $filePath = $input->getArgument('source'); $destinationPath = $input->getArgument('destination'); if (empty($destinationPath)) { $destinationPath = dirname($filePath); } $themeId = $input->getOption('theme'); $theme = new Theme(); $themeFile = __DIR__ . '/../../../../theme/' . $themeId . '/' . $themeId . '.info.yml'; $theme->load($themeFile); $output->writeln("Decompressing file"); $extractDir = $destinationPath . '/deflated'; // $filePath = APPIZY_BASE_DIR . DIRECTORY_SEPARATOR . $filePath; $zip = new ZipArchive(); $zip->open($filePath); $zip->extractTo($extractDir); $zip->close(); $xml_path[] = $extractDir . "/styles.xml"; $xml_path[] = $extractDir . "/content.xml"; $tool = new Tool(true); $output->writeln("Parsing spreadsheet"); $tool->tool_parse_wb($xml_path); $tool->tool_clean(); $output->writeln("Rendering application"); $elements = $tool->tool_render(); $this->renderAndSave($theme, ['spreadSheet' => $tool, 'content' => $elements['content'], 'style' => $elements['style'], 'script' => $elements['script'], 'options' => json_decode($input->getOption('options')), 'libraries' => $elements['libraries']], $destinationPath); $this->copyThemeIncludedFiles($theme, $destinationPath); self::delTree($destinationPath . '/deflated'); }
private function getHumanizedCellName($sheetId, $rowId, $coId) { $sheetName = $this->getSheet($sheetId)->getName(); $colName = Tool::num2alpha($coId); return "'{$sheetName}'." . $colName . ($rowId + 1); }