Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filesize() error for comment in file #12

Closed
postwirt opened this issue Nov 8, 2019 · 2 comments
Closed

filesize() error for comment in file #12

postwirt opened this issue Nov 8, 2019 · 2 comments

Comments

@postwirt
Copy link

postwirt commented Nov 8, 2019

If a comment is written at the very beginning of a file (tried for a css and a js file), then you run into an filesize() error by trying to zip it. The comment is written like /*Comment*/

@jszobody
Copy link
Member

jszobody commented Nov 8, 2019

It sounds like you're adding the raw file contents directly to the Zip, is that correct?

If so, use the ->addRaw($content, $filename) method instead of the catch-all ->add(...) method. The add method tries to guess what you are adding, and that initial slash makes it look like a path on disk.

@postwirt
Copy link
Author

postwirt commented Nov 9, 2019

yes, that is correct.

I tried and it is working. So it was my fault.
Thanks for the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants