You are here

public function FileSystemInterface::createFilename in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::createFilename()
  2. 10 core/lib/Drupal/Core/File/FileSystemInterface.php \Drupal\Core\File\FileSystemInterface::createFilename()

Creates a full file path from a directory and filename.

If a file with the specified name already exists, an alternative will be used.

Parameters

string $basename: The filename.

string $directory: The directory or parent URI.

Return value

string File path consisting of $directory and a unique filename based off of $basename.

Throws

\Drupal\Core\File\Exception\FileException Implementation may throw FileException or its subtype on failure.

1 method overrides FileSystemInterface::createFilename()
FileSystem::createFilename in core/lib/Drupal/Core/File/FileSystem.php
Creates a full file path from a directory and filename.

File

core/lib/Drupal/Core/File/FileSystemInterface.php, line 454

Class

FileSystemInterface
Provides an interface for helpers that operate on files and stream wrappers.

Namespace

Drupal\Core\File

Code

public function createFilename($basename, $directory);