public function StreamWrapperManager::unregister

public StreamWrapperManager::unregister()

Unregisters the tagged stream wrappers.

Internal use only.

File

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

Class

StreamWrapperManager
Provides a StreamWrapper manager.

Namespace

Drupal\Core\StreamWrapper

Code

public function unregister() {
  // Normally, there are definitely wrappers set for the ALL filter. However,
  // in some cases involving many container rebuilds (e.g. WebTestBase),
  // $this->wrappers may be empty although wrappers are still registered
  // globally. Thus an isset() check is needed before iterating.
  if (isset($this->wrappers[StreamWrapperInterface::ALL])) {
    foreach (array_keys($this->wrappers[StreamWrapperInterface::ALL]) as $scheme) {
      stream_wrapper_unregister($scheme);
    }
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StreamWrapper!StreamWrapperManager.php/function/StreamWrapperManager::unregister/8.1.x