예제 #1
0
 /**
  * Download specific revision 
  *
  * @param string $revision_id
  * @return null
  */
 private function _download_revision($revision = null, $inline)
 {
     trace(__FILE__, "_download_revision(...):");
     if (!$revision instanceof ProjectFileRevision) {
         flash_error(lang('file revision dnx'));
         $this->redirectToReferer(get_url('files'));
     }
     // if
     $repository_id = $revision->getRepositoryId();
     if ('fs' == config_option('file_storage_adapter', 'fs')) {
         trace(__FILE__, "_download_revision(...):from fs");
         $is_fs = true;
         $contents = FileRepository::getFilePath($repository_id);
     } else {
         trace(__FILE__, "_download_revision(...):from db");
         $is_fs = false;
         $contents =& $revision->getFileContent();
     }
     trace(__FILE__, "_download_revision(...):{$repository_id}");
     download_contents($contents, $revision->getTypeString(), $revision->getFileName(), $revision->getFileSize(), $inline, $is_fs);
 }
 /**
  * Return content of this file
  *
  * @param void
  * @return string
  */
 function getFilePath()
 {
     return FileRepository::getFilePath($this->getRepositoryId());
 }