Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/StreamWrapper/PrivateStream.php \Drupal\Core\StreamWrapper\PrivateStream::basePath()
  2. 9 core/lib/Drupal/Core/StreamWrapper/PrivateStream.php \Drupal\Core\StreamWrapper\PrivateStream::basePath()

Returns the base path for private://.

Note that this static method is used by \Drupal\system\Form\FileSystemForm so you should alter that form or substitute a different form if you change the class providing the stream_wrapper.private service.

Return value

string|null The base path for private://. NULL means the private directory is not set.

3 calls to PrivateStream::basePath()
FileSystemForm::buildForm in core/modules/system/src/Form/FileSystemForm.php
HtaccessWriter::defaultProtectedDirs in core/lib/Drupal/Core/File/HtaccessWriter.php
PrivateStream::getDirectoryPath in core/lib/Drupal/Core/StreamWrapper/PrivateStream.php
Gets the path that the wrapper is responsible for.

File

core/lib/Drupal/Core/StreamWrapper/PrivateStream.php, line 63

Class

PrivateStream
Drupal private (private://) stream wrapper class.

Namespace

Drupal\Core\StreamWrapper

Code

public static function basePath() {
  return Settings::get('file_private_path');
}