You are here

public function BinaryFileResponse::setAutoEtag in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/BinaryFileResponse.php \Symfony\Component\HttpFoundation\BinaryFileResponse::setAutoEtag()

Automatically sets the ETag header according to the checksum of the file.

1 call to BinaryFileResponse::setAutoEtag()
BinaryFileResponse::setFile in vendor/symfony/http-foundation/BinaryFileResponse.php
Sets the file to stream.

File

vendor/symfony/http-foundation/BinaryFileResponse.php, line 139

Class

BinaryFileResponse
BinaryFileResponse represents an HTTP response delivering a file.

Namespace

Symfony\Component\HttpFoundation

Code

public function setAutoEtag() {
  $this
    ->setEtag(sha1_file($this->file
    ->getPathname()));
  return $this;
}