Stream Wrappers

What is a stream?

Streams are a network object or file that can be read or written to.

Wrappers provide a way to route to these streams.

What is a Scheme?

scheme://target

More info: https://www.php.net/manual/en/intro.stream.php

 

PHP Stream Wrapper: https://www.php.net/manual/en/class.streamwrapper.php

What's the use case for Stream Wrappers?

This module provides wrappers to fetch system files: https://www.drupal.org/project/system_stream_wrapper

 

PHP has built in wrappers for things like file:// and http://.

Drupal adds ones like public:// and private://

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21StreamWr…