function StreamWrapperManager::getScheme

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

Overrides StreamWrapperManagerInterface::getScheme

31 calls to StreamWrapperManager::getScheme()
ConfigHooks::fileDownload in core/modules/config/src/Hook/ConfigHooks.php
Implements hook_file_download().
config_file_download in core/modules/config/config.module
Implements hook_file_download().
CssOptimizer::loadFile in core/lib/Drupal/Core/Asset/CssOptimizer.php
Loads the stylesheet and resolves all @import commands.
FileCopy::isLocalUri in core/modules/migrate/src/Plugin/migrate/process/FileCopy.php
Determines if the given URI or path is considered local.
FileSystem::dirname in core/lib/Drupal/Core/File/FileSystem.php
Gets the name of the directory from a given path.

... See full list

File

core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php, line 293

Class

StreamWrapperManager
Provides a StreamWrapper manager.

Namespace

Drupal\Core\StreamWrapper

Code

public static function getScheme($uri) {
    if (preg_match('/^([\\w\\-]+):\\/\\/|^(data):/', $uri, $matches)) {
        // The scheme will always be the last element in the matches array.
        return array_pop($matches);
    }
    return FALSE;
}

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