stream_wrappers.inc

Version 1.22 (checked in on 2010/12/30 at 22:33:03 by webchick)

Drupal stream wrapper interface.

Provides a Drupal interface and classes to implement PHP stream wrappers for public, private, and temporary files.

A stream wrapper is an abstraction of a file system that allows Drupal to use the same set of methods to access both local files and remote resources.

Note that PHP 5.2 fopen() only supports URIs of the form "scheme://target" despite the fact that according to RFC 3986 a URI's scheme component delimiter is in general just ":", not "://". Because of this PHP limitation and for consistency Drupal will only accept URIs of form "scheme://target".

See also

http://www.faqs.org/rfcs/rfc3986.html

http://bugs.php.net/bug.php?id=47070

Classes

NameDescription
DrupalLocalStreamWrapperDrupal stream wrapper base class for local files.
DrupalPrivateStreamWrapperDrupal private (private://) stream wrapper class.
DrupalPublicStreamWrapperDrupal public (public://) stream wrapper class.
DrupalTemporaryStreamWrapperDrupal temporary (temporary://) stream wrapper class.

Interfaces

NameDescription
DrupalStreamWrapperInterfaceDrupal stream wrapper extension.
StreamWrapperInterfaceGeneric PHP stream wrapper interface.

Constants

NameDescription
STREAM_WRAPPERS_ALLStream wrapper bit flag -- a filter that matches all wrappers.
STREAM_WRAPPERS_HIDDENStream wrapper type flag -- not visible in the UI or accessible via web, but readable and writable. E.g. the temporary directory for uploads.
STREAM_WRAPPERS_LOCALStream wrapper bit flag -- refers to a local file system location.
STREAM_WRAPPERS_LOCAL_HIDDENStream wrapper type flag -- hidden, readable and writeable using local files.
STREAM_WRAPPERS_LOCAL_NORMALStream wrapper type flag -- visible, readable and writeable using local files.
STREAM_WRAPPERS_NORMALStream wrapper type flag -- the default when 'type' is omitted from hook_stream_wrappers(). This does not include STREAM_WRAPPERS_LOCAL, because PHP grants a greater trust level to local files (for example, they can be used in an…
STREAM_WRAPPERS_READStream wrapper bit flag -- wrapper is readable (almost always true).
STREAM_WRAPPERS_READ_VISIBLEStream wrapper type flag -- visible and read-only.
STREAM_WRAPPERS_VISIBLEStream wrapper bit flag -- exposed in the UI and potentially web accessible.
STREAM_WRAPPERS_WRITEStream wrapper bit flag -- wrapper is writeable.
STREAM_WRAPPERS_WRITE_VISIBLEStream wrapper type flag -- visible, readable and writeable.