You are here

protected function ExtensionStreamBase::getOwnerName in System stream wrapper 8

Gets the module, theme, or profile name of the current URI.

This will return the name of the module, theme or profile e.g.

SystemStream::getOwnerName('module://foo');

and

SystemStream::getOwnerName('module://foo/');

will both return

'foo';

Return value

string The extension name.

3 calls to ExtensionStreamBase::getOwnerName()
LibraryStream::getOwnerName in src/StreamWrapper/LibraryStream.php
Gets the module, theme, or profile name of the current URI.
ModuleStream::getOwnerName in src/StreamWrapper/ModuleStream.php
Gets the module, theme, or profile name of the current URI.
ThemeStream::getOwnerName in src/StreamWrapper/ThemeStream.php
Gets the module, theme, or profile name of the current URI.
3 methods override ExtensionStreamBase::getOwnerName()
LibraryStream::getOwnerName in src/StreamWrapper/LibraryStream.php
Gets the module, theme, or profile name of the current URI.
ModuleStream::getOwnerName in src/StreamWrapper/ModuleStream.php
Gets the module, theme, or profile name of the current URI.
ThemeStream::getOwnerName in src/StreamWrapper/ThemeStream.php
Gets the module, theme, or profile name of the current URI.

File

src/StreamWrapper/ExtensionStreamBase.php, line 44

Class

ExtensionStreamBase
Defines a base stream wrapper implementation.

Namespace

Drupal\system_stream_wrapper\StreamWrapper

Code

protected function getOwnerName() {
  $uri_parts = explode('://', $this->uri, 2);

  // Remove the trailing filename from the path.
  $length = strpos($uri_parts[1], '/');
  return $length === FALSE ? $uri_parts[1] : substr($uri_parts[1], 0, $length);
}