本文整理匯總了PHP中Symfony\Component\HttpFoundation\BinaryFileResponse::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP BinaryFileResponse::__construct方法的具體用法?PHP BinaryFileResponse::__construct怎麽用?PHP BinaryFileResponse::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\HttpFoundation\BinaryFileResponse
的用法示例。
在下文中一共展示了BinaryFileResponse::__construct方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Initialize the response with the file path and the original's file size
* The original file's size is very important to prevent the null character padding of the encryption function at the end of the file
* which can introduce a slight difference in the filesize wich will break checksums verifications
*
* @param EncryptionManager $encryptionManager
* @param SplFileInfo|string $file
* @param int $fileSize
* @param int $status
* @param array $headers
* @param null|string $contentDisposition
* @param bool $autoEtag
* @param bool $autoLastModified
*/
public function __construct(EncryptionManager $encryptionManager, $file, $fileSize, $status = 200, $headers = array(), $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
{
parent::__construct($file, $status, $headers, false, $contentDisposition, $autoEtag, $autoLastModified);
$this->setPrivate();
$this->fileSize = $fileSize;
$this->encryptionManager = $encryptionManager;
}