Closed harikt closed 9 years ago
@harikt Hi, this is something I know. The rackspace sdk closes the resource internally. Which is a unexpected side-effect. One should always first check if the resource is still valid before closing.
Thank you. Just wanted to mention it.
Hari K T
You can ring me : +91 9388 75 8821
http://harikt.com , https://github.com/harikt , http://www.linkedin.com/in/harikt , http://www.xing.com/profile/Hari_KT
Skype : kthari85 Twitter : harikt
On Fri, May 15, 2015 at 11:59 AM, Frank de Jonge notifications@github.com wrote:
@harikt https://github.com/harikt Hi, this is something I know. The rackspace sdk closes the resource internally. Which is a unexpected side-effect. One should always first check if the resource is still valid before closing.
— Reply to this email directly or view it on GitHub https://github.com/thephpleague/flysystem-rackspace/issues/7#issuecomment-102282242 .
If I'm correct Amazon S3 SDK does the same.
So I think there should be mentioned that about it:
if (is_resource($stream)) {
fclose($stream);
}
I do agree it will be nice to mention it.
I was making use of the Rackspace adapter via flysytsem .
The code is as below .
I noticed when trying to close it says not a resource.
PHP Warning: fclose(): xx is not a valid stream resource in ...
Wonder whether flysystem at some point is automatically closing the same ?
Good thing is it is sending the data to the Cloud. So the file is already present on both local and server :) .