function StreamWrapperManager::getWrappers

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

Overrides StreamWrapperManagerInterface::getWrappers

2 calls to StreamWrapperManager::getWrappers()
StreamWrapperManager::getDescriptions in core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
Returns registered stream wrapper descriptions.
StreamWrapperManager::getNames in core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
Returns registered stream wrapper names.

File

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

Class

StreamWrapperManager
Provides a StreamWrapper manager.

Namespace

Drupal\Core\StreamWrapper

Code

public function getWrappers($filter = StreamWrapperInterface::ALL) {
    if (isset($this->wrappers[$filter])) {
        return $this->wrappers[$filter];
    }
    elseif (isset($this->wrappers[StreamWrapperInterface::ALL])) {
        $this->wrappers[$filter] = [];
        foreach ($this->wrappers[StreamWrapperInterface::ALL] as $scheme => $info) {
            // Bit-wise filter.
            if (($info['type'] & $filter) == $filter) {
                $this->wrappers[$filter][$scheme] = $info;
            }
        }
        return $this->wrappers[$filter];
    }
    else {
        return [];
    }
}

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