Why might I need Alternative Stream Wrappers?

Some hosting configurations with multiple webservers use a mix of filesystems local to each webserver and storage which is shared between the webs (e.g. using nfs or gluster).

It can sometimes be useful to, for example, use fast local storage for temp files wherever possible, but shared storage where the webs might need to share access to the same set of temporary files.

The Views data export module is a good example of where shared temp storage is useful. See: https://drupal.org/node/1782038

This simple module allows Drupal to keep using the built-in stream wrappers (e.g. public:// and temporary://) but also have the use of one or more Alternative Stream Wrappers for cases like the shared temporary directory.

There may be other uses too - the module aims to be flexible.

Using Alternative Stream Wrappers

The alt_stream_wrappers_stream_wrappers() function defines a default alt-temp:// stream wrapper, and this can be used out of the box; all you need to do is set a value for the variable alt_stream_wrappers_alt-temp_path e.g.:

drush vset alt_stream_wrappers_alt-temp_path '/mnt/nfs/tmp'

If you need more, or different wrappers, you can override the default by setting a variable, most likely in settings.php

See the README.txt file for more details.

Project information

Releases