validateConfig()) { // No temp file given from wizard // Old archive still exists? pretend it worked... if ($this->archive() === false || !file_exists($this->archive())) return false; if ($this->currentVersion() == 1) { // Need an upgrade return Taskmanager::submit('RecompressArchive', array( 'inputFiles' => [$this->archive() => false], 'outputFile' => $tgz, 'forceRoot' => true, // Force this for old modules for backward compat )); } // Nothing to do return true; } $task = Taskmanager::submit('MoveFile', array( 'source' => $this->tmpFile, 'destination' => $tgz, 'parentTask' => $parent, 'failOnParentFail' => false )); return $task; } protected function moduleVersion() { return self::VERSION; } protected function validateConfig() { return $this->tmpFile !== false && file_exists($this->tmpFile); } public function setData($key, $value) { // Sets the temp file from the wizard, where it stored the processed archive if ($key !== 'tmpFile' || !file_exists($value)) return false; $this->tmpFile = $value; return true; } public function getData($key) { return false; } public function allowDownload() { return true; } }