/** The preparation function should be called before calling Assemble() */ public function preparation() { foreach ($this->idmlPackages as $package) { $package->unzip(); // Check the first package for PXE tags. We assume that all of the IDML files // have been prepared the same way, either with or without the "pxe" root. if ($package === $this->idmlPackages[0]) { $this->pxeTagsAdded = $this->isThisPxe($package); } $package->readDesignMap(); $this->numPages += $package->determinePageCount(); } if ($this->processor) { $this->processor->updatePageCount($this->numPages); } // We are incrementing progress, per page, in three phases. // One phase is parsing. (numPages) // One phase is producing. (numPages) // One phase is thumbnail creation. (actualPages) if ($this->progressUpdater) { $maxSteps = ProgressUpdater::WEIGHTING_IDML_PHASE1 * $this->numPages + ProgressUpdater::WEIGHTING_IDML_PHASE2 * $this->numPages + ProgressUpdater::WEIGHTING_IDML_PHASE3 * $this->numPages; // actual pages is not yet knwon $this->progressUpdater->startProgress($maxSteps); } return true; }
public function initProgress($numSteps = 2000) { if ($this->progressBookId) { $this->progress = ProgressUpdater::getInstance($this->progressBookId); } else { $this->progress = ProgressUpdater::getInstance($this->bookId); } $this->progress->completedState = $this->completedState; $this->progress->startProgress($numSteps); }