コード例 #1
0
ファイル: Response.php プロジェクト: rvanbaalen/bili
 /**
  * Generate a download link for an exisiting file in the cache.
  *
  * @param  string $strCachedName The name of the file in the cache
  * @param  string $strFilename File name
  * @return string The generated download link
  */
 public static function generateDownloadLinkForExisting($strCachedName, $strFilename, $strDownloadUrl = null)
 {
     // Save in session
     $_SESSION["documents"][$strCachedName] = $strFilename;
     if (is_null($strDownloadUrl)) {
         $objRewrite = Rewrite::getInstance();
         $strDownloadUrl = $objRewrite->getUrl(SECTION_DOCUMENT, CMD_DOWNLOAD, null, null, SUB_SECTION_EMPTY, array("t" => $strCachedName));
     } else {
         $strDownloadUrl .= "/t/" . Rewrite::encode($strCachedName);
     }
     $strReturn = Request::getRootURI() . $strDownloadUrl;
     return $strReturn;
 }