Use go:embed embed.FS rather than tar + exporting files to a temp directory? #1178
Closed
nickchomey
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This would need support in PHP itself (particularly the require/include/require_once/include_once directives) as well as a custom stream filter to intercept local files -- it would be similar to the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've made this a discussion rather than issue, as I'm not sure if it is valid or not.
I was just exploring how FrankenPHP does the embedded builds, and it looks like
build-static.sh
script which creates a tar of the application which gets embeddedI wonder if the whole process could be simplified if you use the embed.FS which "implements fs.FS, so it can be used with any package that understands file system interfaces, including net/http, text/template, and html/template."?
Moreover, it might even be higher performance since the files would be read from within the binary rather than the temp directory. Furthermore, I could see this being useful in the sense of wanting to protect Intellectual Property by not extracting php files. I dont know if this would result in extra/excessive ram usage though, as compared to the tar extraction.
I also wonder if it could perhaps even somehow be pre-compiled into the opcache?
Beta Was this translation helpful? Give feedback.
All reactions