Drupal 8  8.0.2
ImageStyleDownloadController Class Reference
Inheritance diagram for ImageStyleDownloadController:

Public Member Functions

 __construct (LockBackendInterface $lock, ImageFactory $image_factory, LoggerInterface $logger)
 
 deliver (Request $request, $scheme, ImageStyleInterface $image_style)
 
- Public Member Functions inherited from FileDownloadController
 download (Request $request, $scheme= 'private')
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $lock
 
 $imageFactory
 
 $logger
 

Detailed Description

Defines a controller to serve image styles.

Constructor & Destructor Documentation

__construct ( LockBackendInterface  $lock,
ImageFactory  $image_factory,
LoggerInterface  $logger 
)

Constructs a ImageStyleDownloadController object.

Parameters
\Drupal\Core\Lock\LockBackendInterface$lockThe lock backend.
\Drupal\Core\Image\ImageFactory$image_factoryThe image factory.
\Psr\Log\LoggerInterface$loggerA logger instance.

References Drupal\lock(), and Drupal\logger().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container)
static

{}

deliver ( Request  $request,
  $scheme,
ImageStyleInterface  $image_style 
)

Generates a derivative, given a style and image path.

After generating an image, transfer it to the requesting agent.

Parameters
\Symfony\Component\HttpFoundation\Request$requestThe request object.
string$schemeThe file scheme, defaults to 'private'.
\Drupal\image\ImageStyleInterface$image_styleThe image style to deliver.
Returns
| The transferred file as response or some error response.
Exceptions
\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpExceptionThrown when the user does not have access to the file.
\Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpExceptionThrown when the file is still being generated.

References ImageStyleInterface\buildUri(), Drupal\config(), ImageStyleInterface\createDerivative(), file_stream_wrapper_valid_scheme(), ImageStyleInterface\getPathToken(), Crypt\hashBase64(), EntityInterface\id(), Drupal\lock(), Drupal\logger(), Drupal\moduleHandler(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: