private function renderFileContent(HTTPRequest $request, Project $project, $project_path)
 {
     include_once 'HTTP/Download.php';
     $full_path = $this->parser->getFullPath($project_path);
     $this->xferlog_dao->storeWebDownload($request->getCurrentUser()->getId(), $project->getID(), $_SERVER['REQUEST_TIME'], $project_path);
     return !PEAR::isError(HTTP_Download::staticSend(array('file' => $full_path, 'cache' => false, 'contentdisposition' => array(HTTP_DOWNLOAD_ATTACHMENT, basename($full_path)), 'buffersize' => self::TRANSFERT_BUFFER_SIZE)));
 }
示例#2
0
 private function parseLine($line, $latest_timestamp)
 {
     try {
         $entry = $this->parser->extract(trim($line));
         if ($entry->current_time >= $latest_timestamp) {
             $user_id = $this->getUserId($entry, $line);
             $project_id = $this->getProjectId($entry, $line);
             return $this->dao->store($user_id, $project_id, $entry);
         }
     } catch (InvalidEntryException $exception) {
         $this->errors[] = $exception->getMessage();
     }
     return false;
 }