function FileUploadResource::generateLockIdFromFileUri

Same name in other branches
  1. 9 core/modules/file/src/Plugin/rest/resource/FileUploadResource.php \Drupal\file\Plugin\rest\resource\FileUploadResource::generateLockIdFromFileUri()
  2. 8.9.x core/modules/file/src/Plugin/rest/resource/FileUploadResource.php \Drupal\file\Plugin\rest\resource\FileUploadResource::generateLockIdFromFileUri()
  3. 10 core/modules/file/src/Plugin/rest/resource/FileUploadResource.php \Drupal\file\Plugin\rest\resource\FileUploadResource::generateLockIdFromFileUri()

Generates a lock ID based on the file URI.

Parameters

$file_uri: The file URI.

Return value

string The generated lock ID.

File

core/modules/file/src/Plugin/rest/resource/FileUploadResource.php, line 280

Class

FileUploadResource
File upload resource.

Namespace

Drupal\file\Plugin\rest\resource

Code

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

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