/** * Returns current package archive. * * @return \wcf\system\package\PackageArchive */ public function getArchive() { if ($this->archive === null) { $package = $this->getPackage(); // check if we're doing an iterative update of the same package if ($this->previousPackageData !== null && $this->getPackage()->package == $this->previousPackageData['package']) { if (Package::compareVersion($this->getPackage()->packageVersion, $this->previousPackageData['packageVersion'], '<')) { // fake package to simulate the package version required by current archive $this->getPackage()->setPackageVersion($this->previousPackageData['packageVersion']); } } $this->archive = new PackageArchive($this->queue->archive, $this->getPackage()); if (FileUtil::isURL($this->archive->getArchive())) { // get return value and update entry in // package_installation_queue with this value $archive = $this->archive->downloadArchive(); $queueEditor = new PackageInstallationQueueEditor($this->queue); $queueEditor->update(array('archive' => $archive)); } $this->archive->openArchive(); } return $this->archive; }