function ImageModuleTestHooks::fileDownload

Implements hook_file_download().

File

core/modules/image/tests/modules/image_module_test/src/Hook/ImageModuleTestHooks.php, line 54

Class

ImageModuleTestHooks
Hook implementations for image_module_test.

Namespace

Drupal\image_module_test\Hook

Code

public function fileDownload($uri) : array {
    $default_uri = \Drupal::keyValue('image')->get('test_file_download', FALSE);
    if ($default_uri == $uri) {
        return [
            'X-Image-Owned-By' => 'image_module_test',
        ];
    }
    return [];
}

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