function FileUploadHandler::generateLockId

Same name in other branches
  1. 11.x core/modules/file/src/Upload/FileUploadHandler.php \Drupal\file\Upload\FileUploadHandler::generateLockId()

Generates a lock ID based on the file URI.

1 call to FileUploadHandler::generateLockId()
FileUploadHandler::handleFileUpload in core/modules/file/src/Upload/FileUploadHandler.php
Creates a file from an upload.

File

core/modules/file/src/Upload/FileUploadHandler.php, line 476

Class

FileUploadHandler
Handles validating and creating file entities from file uploads.

Namespace

Drupal\file\Upload

Code

protected static function generateLockId(string $fileUri) : string {
    return 'file:upload:' . Crypt::hashBase64($fileUri);
}

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