You are here

protected static function TemporaryJsonapiFileFieldUploader::generateLockIdFromFileUri in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/jsonapi/src/Controller/TemporaryJsonapiFileFieldUploader.php \Drupal\jsonapi\Controller\TemporaryJsonapiFileFieldUploader::generateLockIdFromFileUri()

Generates a lock ID based on the file URI.

Parameters

string $file_uri: The file URI.

Return value

string The generated lock ID.

1 call to TemporaryJsonapiFileFieldUploader::generateLockIdFromFileUri()
TemporaryJsonapiFileFieldUploader::handleFileUploadForField in core/modules/jsonapi/src/Controller/TemporaryJsonapiFileFieldUploader.php
Creates and validates a file entity for a file field from a file stream.

File

core/modules/jsonapi/src/Controller/TemporaryJsonapiFileFieldUploader.php, line 490

Class

TemporaryJsonapiFileFieldUploader
Reads data from an upload stream and creates a corresponding file entity.

Namespace

Drupal\jsonapi\Controller

Code

protected static function generateLockIdFromFileUri($file_uri) {
  return 'file:jsonapi:' . Crypt::hashBase64($file_uri);
}