10000 [AssetMapper] Add a Filesystem abstraction · Issue #50221 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AssetMapper] Add a Filesystem abstraction #50221

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

Closed
shyim opened this issue May 3, 2023 · 3 comments · Fixed by #51847
Closed

[AssetMapper] Add a Filesystem abstraction #50221

shyim opened this issue May 3, 2023 · 3 comments · Fixed by #51847

Comments

@shyim
Copy link
Contributor
shyim commented May 3, 2023

Description

Right now the AssetMapper command directly writes into the public folder.

It would be nice if there would be an abstraction to the Filesystem so I could directly use Flysystem and upload it to S3/whatever. A workaround could be to let it copy to an temporary directory and from there to S3 (assuming the public folder is read-only).

Example

No response

@weaverryan
Copy link
Member

I believe the filesystem is only used for writing in the 1 referenced place: AssetMapperCompileCommand

If someone is interested, a AssetFilesystemInterface + a LocalAssetFilesystem implementation (which uses the Filesystem class like now) could be added. That would give users the flexibility to decorate or replace this new, core "asset filesystem" service with their own implementation.

Who wants to create this? It's easy now, as we don't yet need to worry about changing constructor arguments of AssetMapperCompileCommand from a BC perspective. But it'll get harder after 6.4 ;).

@shyim
Copy link
Contributor Author
shyim commented Jul 11, 2023

It looks not so good to do right now. We need kinda a virtual filesystem. But this interface expects that you return a absolute path:

public function getPublicFilesystemPath(): string;

Do we deprecate that and make an generic filesystem interface or what would be the idea?

@weaverryan
Copy link
Member

@shyim WDYT about #51847? I think it'll give you the hook you need

@fabpot fabpot closed this as completed in d261eeb Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0