function StreamWrapperManager::getWrappers

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php \Drupal\Core\StreamWrapper\StreamWrapperManager::getWrappers()
  2. 8.9.x 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()
2 calls to StreamWrapperManager::getWrappers()
StreamWrapperManager::getDescriptions in core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php
StreamWrapperManager::getNames in core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php

File

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

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.