function ImageStyleDownloadController::__construct

Same name in other branches
  1. 8.9.x core/modules/image/src/Controller/ImageStyleDownloadController.php \Drupal\image\Controller\ImageStyleDownloadController::__construct()
  2. 10 core/modules/image/src/Controller/ImageStyleDownloadController.php \Drupal\image\Controller\ImageStyleDownloadController::__construct()
  3. 11.x core/modules/image/src/Controller/ImageStyleDownloadController.php \Drupal\image\Controller\ImageStyleDownloadController::__construct()

Constructs an ImageStyleDownloadController object.

Parameters

\Drupal\Core\Lock\LockBackendInterface $lock: The lock backend.

\Drupal\Core\Image\ImageFactory $image_factory: The image factory.

\Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $stream_wrapper_manager: The stream wrapper manager.

\Drupal\Core\File\FileSystemInterface $file_system: The system service.

Overrides FileDownloadController::__construct

File

core/modules/image/src/Controller/ImageStyleDownloadController.php, line 67

Class

ImageStyleDownloadController
Defines a controller to serve image styles.

Namespace

Drupal\image\Controller

Code

public function __construct(LockBackendInterface $lock, ImageFactory $image_factory, StreamWrapperManagerInterface $stream_wrapper_manager, FileSystemInterface $file_system = NULL) {
    parent::__construct($stream_wrapper_manager);
    $this->lock = $lock;
    $this->imageFactory = $image_factory;
    $this->logger = $this->getLogger('image');
    if (!isset($file_system)) {
        @trigger_error('Not defining the $file_system argument to ' . __METHOD__ . ' is deprecated in drupal:9.1.0 and will throw an error in drupal:10.0.0.', E_USER_DEPRECATED);
        $file_system = \Drupal::service('file_system');
    }
    $this->fileSystem = $file_system;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.