4

I am in the process of migrating a lot of files in a large PHP application from local to remote storage. File operations are being transitioned using PHP stream wrappers as an intermediate solution so that we can easily change calls such as fopen('/local/file/path') to fopen('scheme://remote/file/path').

So far I've come across only one feature which is broken by this, which is the GD image library (its file write methods such as imagejpeg, imagegif and imagepng will not write to file streams).

In addition, PHP security options deny include() and require() calls on URLs.

I've tried looking for a list of known incompatibilities but can't find one.

I already have several workarounds available, so I'm covered there, and we'll perform extensive testing, but I would like to know in advance of any pain points if someone's been through the same process before.

Specifically, we are using PHP 5.3.6 on Debian Squeeze.

hakre
  • 193,403
  • 52
  • 435
  • 836
user1184088
  • 51
  • 1
  • 5

1 Answers1

0

I would suggest reading this:

http://www.php.net/manual/en/class.streamwrapper.php

A lot of your answers will be found there.

Barry Chapman
  • 6,690
  • 3
  • 36
  • 64
  • Sorry, but the answers aren't there, and I've been over that section of the PHP manual many times when actually implementing the wrapper code. That page only lists _how_ to implement stream wrappers, not which features are incompatible with them (specifically, there's no mention of the features I highlighted in my original question). – user1184088 Feb 12 '12 at 02:32