/** * Updated index list with page verions information. * * @param \derhasi\RedmineToGit\WikiPageVersion $version */ public function updateWithVersion(WikiPageVersion $version) { if (isset($this->data[$version->title])) { $version->updatePage($this->data[$version->title]); } else { $this->data[$version->title] = $version->createPage(); } }
/** * Update files for the given version. * * @param WikiPageVersion $version */ protected function updateFilesForVersion($version) { // Update some files. $version_files = $version->writeFile($this->workingPath); $max_file_size = (int) $this->currentInput->getOption('maxFilesize'); // Download attachments. As this may take longer, we need a progress to // to update. $attachment_files = $version->writeAttachments($this->workingPath, $max_file_size, $this->currentOutput, $this->getHelperSet()->get('progress')); // Update index on each commit. $this->wikiIndex->updateWithVersion($version); $index_files = $this->wikiIndex->writeFile($this->workingPath); // Add commit message with author information and correct date foreach (array_merge($version_files, $attachment_files, $index_files) as $file) { $this->git->add($file->relativeTo($this->repoPath)->string()); } }