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

Deploy: Make user download index.html as .zip folder #21

Closed
Adedoyin-Emmanuel opened this issue Jul 30, 2023 · 4 comments · Fixed by #32
Closed

Deploy: Make user download index.html as .zip folder #21

Adedoyin-Emmanuel opened this issue Jul 30, 2023 · 4 comments · Fixed by #32
Assignees

Comments

@Adedoyin-Emmanuel
Copy link
Contributor

We can add an option to make the user download the index.html file as a zipped file so they can easily deploy it on Netlify

Screenshot from 2023-07-30 17-57-40
pages.

@chriskthomas
Copy link
Owner

Good idea. This is possible with output buffers and the ziparchive library in php:

As an alternative to ziparchive and tmpfile, I could use ZipStream. However, that would complicate the project somewhat.

This is probably something that I should do, but if someone thinks that they can do it, I'm happy to assign.

@Adedoyin-Emmanuel
Copy link
Contributor Author

@chriskthomas can you assign the task to me

@chriskthomas
Copy link
Owner

@chriskthomas can you assign the task to me

Sure! I think you'll want to:

  • Refactor the code in api.php so that it always writes to an output buffer
  • Add a checkbox to the interface in index.php for zipping the file
  • When api.php sees that the checkbox is false: print the output buffer and exit
  • When api.php sees that the checkbox is true: (1) create a tempfile zip archive, (2) add the output buffer as a string to the archive, and (3) send the archive as a download

@chriskthomas
Copy link
Owner

@Adedoyin-Emmanuel are you still interested in doing this? Let me know if you need any help.

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

Successfully merging a pull request may close this issue.

2 participants