function PrivateStream::basePath

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/StreamWrapper/PrivateStream.php \Drupal\Core\StreamWrapper\PrivateStream::basePath()
  2. 10 core/lib/Drupal/Core/StreamWrapper/PrivateStream.php \Drupal\Core\StreamWrapper\PrivateStream::basePath()
  3. 11.x 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.

4 calls to PrivateStream::basePath()
FileSystemForm::buildForm in core/modules/system/src/Form/FileSystemForm.php
Form constructor.
HtaccessWriter::defaultProtectedDirs in core/lib/Drupal/Core/File/HtaccessWriter.php
Returns a list of the default protected directories.
PrivateStream::getDirectoryPath in core/lib/Drupal/Core/StreamWrapper/PrivateStream.php
Gets the path that the wrapper is responsible for.
system_requirements in core/modules/system/system.install
Implements hook_requirements().

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');
}

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