flownative / flow-aws-s3

Amazon S3 adaptor for Neos and Flow
MIT License
18 stars 33 forks source link

When publishing static resources a call to fclose in publishFile results in an error #5

Closed revsbech closed 9 years ago

revsbech commented 9 years ago

Having configured everything correctly to publish static resorces to an S3 Bucket, I get an error when the call to flose is done in the publishFile method of the S3Target. The file is correctly published, but the exception thrown when trying to fclose the resource results bubbles up the exceotion and no more files are published.

In the errorlog I first see that the file is published (and it appears correctly in the S3 bucket):

Successfully published resource as object "sites/priceportal/static/TYPO3.Flow/Error/Debugger.css" in bucket "flow.publish" with MD5 hash "ba63e945db7352ce5188944b1a69791e"

Then right after I see

Failed publishing resource as object "sites/priceportal/static/TYPO3.Flow/Error/Debugger.css" in bucket "flow.publish" with MD5 hash "ba63e945db7352ce5188944b1a69791e": Warning: fclose(): 2807 is not a valid stream resource in /home/sites/priceportal/flow/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Flownative_Aws_S3_S3Target.php line 322

I'm not sure, but I think the call to fclose in S3Target should be removed. Removing the call makes everything work smoothly.

robertlemke commented 9 years ago

Thanks for reporting this issue, @revsbech! In the meantime it has also been fixed by Hans #3.

Please note that publishing of CSS files is still a bit problematic, because contained URLs (for example, for a background image) won't be adjusted to the public (CDN) URL yet.