Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StreamWrapperManager.php

function 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 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 [];
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal