function StreamWrapperManagerInterface::getViaScheme

Same name in other branches
  1. 9 core/lib/Drupal/Core/StreamWrapper/StreamWrapperManagerInterface.php \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::getViaScheme()
  2. 8.9.x core/lib/Drupal/Core/StreamWrapper/StreamWrapperManagerInterface.php \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::getViaScheme()
  3. 10 core/lib/Drupal/Core/StreamWrapper/StreamWrapperManagerInterface.php \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::getViaScheme()

Returns a reference to the stream wrapper class responsible for a scheme.

This helper method returns a stream instance using a scheme. That is, the passed string does not contain a "://". For example, "public" is a scheme but "public://" is a URI (stream). This is because the later contains both a scheme and target despite target being empty.

Note: the instance URI will be initialized to "scheme://" so that you can make the customary method calls as if you had retrieved an instance by URI.

Parameters

string $scheme: If the stream was "public://target", "public" would be the scheme.

Return value

\Drupal\Core\StreamWrapper\StreamWrapperInterface|bool Returns a new stream wrapper object appropriate for the given $scheme. For example, for the public scheme a stream wrapper object (Drupal\Core\StreamWrapper\PublicStream). FALSE is returned if no registered handler could be found.

1 method overrides StreamWrapperManagerInterface::getViaScheme()
StreamWrapperManager::getViaScheme in core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
Returns a reference to the stream wrapper class responsible for a scheme.

File

core/lib/Drupal/Core/StreamWrapper/StreamWrapperManagerInterface.php, line 130

Class

StreamWrapperManagerInterface
Provides a StreamWrapper manager.

Namespace

Drupal\Core\StreamWrapper

Code

public function getViaScheme($scheme);

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