コード例 #1
0
	/**
	 * Returns current package archive.
	 * 
	 * @return	wcf\system\package\PackageArchive
	 */
	public function getArchive() {
		if ($this->archive === null) {
			$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;
	}
コード例 #2
0
 /**
  * Executes post-setup actions.
  */
 public function completeSetup()
 {
     // rebuild dependencies
     Package::rebuildPackageDependencies($this->queue->packageID);
     // mark queue as done
     $queueEditor = new PackageInstallationQueueEditor($this->queue);
     $queueEditor->update(array('done' => 1));
     // remove node data
     $this->nodeBuilder->purgeNodes();
     // update package version
     if ($this->action == 'update') {
         $packageEditor = new PackageEditor($this->getPackage());
         $packageEditor->update(array('updateDate' => TIME_NOW, 'packageVersion' => $this->archive->getPackageInfo('version')));
     }
     // clear language files once whole installation is completed
     LanguageEditor::deleteLanguageFiles();
     // reset all caches
     CacheHandler::getInstance()->clear(WCF_DIR . 'cache/', '*');
 }