I think your script is well-written and is certainly useful for me.
If you could stand a little criticism:
1) it could do with some documentation on how to use it - I've managed to reverse engineer that the format of the url should be:
2) it doesn't handle failures gracefully.
- I've changed the E_USER_ERROR constants to E_USER_WARNING to prevent the script from bombing out when an error occurs.
- I've changed the return value from smb_stream_wrapper::stream_open() from 'return TRUE;' to 'return is_resource($this->stream);' but that doesn't give me the expected behaviour for non-existent/non-accessible files (file_get_contents() now returns an empty string instead of false)
|2010-01-24 21:59:44 - In reply to message 1 from Colin McKinnon|
|I have not been able to get this class to work.|
I am a newbie with PHP classes, and was hoping for a simple example of opening a connection with this class.
I need open a file on a Windows UNC share. I am using PHP 5.2/IIS 6.0/fastCGI. I know how to handle files and streams and all that, but I can't get a successful file handle from fopen.
Would it be possible to post a little sample code using this class?
Thanks in advance,