Skip to content

Add support for preloading files in nested directories #82

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jasalt
Copy link

@jasalt jasalt commented May 16, 2025

Allow PhpWeb constructor's files parameter and tag attribute data-files to preload files with nested directory structure.

This way e.g. Composer's vendor directory can be preloaded by specifying it's content as a single JSON object / file which can be created with script such as https://gist.github.com/jasalt/b50f60914be75b8dd3ee18f878d801c1.

Provides alternate way to initializing WASM FS where currently copying a single compressed file and extracting it in WASM PHP code is one popular method. This does not require running any PHP initialization code in Wasm.

Allow `PhpWeb` constructor's `files` parameter and tag attribute `data-files` to preload files with nested directory structure.
@jasalt
Copy link
Author

jasalt commented May 16, 2025

Didn't test building this yet, just patched this code locally in NPM package sources and got with Composer require_once '/vendor/autoload.php'; working with it (demo repo).

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 this pull request may close these issues.

1 participant