You are here

public function FileSystem::uriScheme in Drupal 8

Returns the scheme of a URI (e.g. a stream).

Parameters

string $uri: A stream, referenced as "scheme://target" or "data:target".

Return value

string|bool A string containing the name of the scheme, or FALSE if none. For example, the URI "public://example.txt" would return "public".

Overrides FileSystemInterface::uriScheme

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface::getScheme() instead.

See also

https://www.drupal.org/node/3035273

File

core/lib/Drupal/Core/File/FileSystem.php, line 294

Class

FileSystem
Provides helpers to operate on files and stream wrappers.

Namespace

Drupal\Core\File

Code

public function uriScheme($uri) {
  @trigger_error('FileSystem::uriScheme() is deprecated in drupal:8.8.0. It will be removed from drupal:9.0.0. Use \\Drupal\\Core\\StreamWrapper\\StreamWrapperManagerInterface::getScheme() instead. See https://www.drupal.org/node/3035273', E_USER_DEPRECATED);
  return StreamWrapperManager::getScheme($uri);
}