Instead of using stream wrappers correctly, the module attempts to "unwrap" the stream URLs into file system paths. This means that all of the advantages with stream wrappers are lost. In particular, it means that stream wrappers that do not work directly on the file system cannot be used.

The fix for this is simple: Don't resolve URLs to real file system paths. Let PHP's stream wrapper handling do the resolution internally.

CommentFileSizeAuthor
#1 1450966-1-no-realpath.patch1.33 KBmbutcher
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mbutcher’s picture

FileSize
1.33 KB

Attached is a patch that resolves the issue. It does so this way:

  • If the path looks like an FS path (no stream wrapper), it is treated as such.
  • If the path has a scheme, it is treated as a stream.

This is flexible enough to allow public:// and private:// handlers to be swapped. It has been tested on a remote Swift object store from HPCloud.