You are here

protected function LibraryStream::getDrupalRoot in System stream wrapper 8

Return the path to the Drupal root.

Since stream wrappers don't allow us to pass in __construct() parameters, we have to fall back to \Drupal.

Return value

string

2 calls to LibraryStream::getDrupalRoot()
LibraryStream::getDirectoryPath in src/StreamWrapper/LibraryStream.php
Gets the path that the wrapper is responsible for.
LibraryStream::getOwnerName in src/StreamWrapper/LibraryStream.php
Gets the module, theme, or profile name of the current URI.

File

src/StreamWrapper/LibraryStream.php, line 66

Class

LibraryStream
Defines the read-only library:// stream wrapper for library files.

Namespace

Drupal\system_stream_wrapper\StreamWrapper

Code

protected function getDrupalRoot() {
  if (!isset($this->drupalRoot)) {
    $this->drupalRoot = \Drupal::root();
  }
  return $this->drupalRoot;
}