public function download() { $result = $this->create(); if (is_string($result)) { set_time_limit(180); // large zip files might download slowly $this->download_headers(); Filer::download_file($result); $result = (object) array("error" => false); } $this->clean(); return $result; }