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

Stream support #56

Closed
Sander-Toonen opened this issue May 28, 2015 · 11 comments
Closed

Stream support #56

Sander-Toonen opened this issue May 28, 2015 · 11 comments
Assignees

Comments

@Sander-Toonen
Copy link

Is there a way to hook a filesystem into for instance the liipImagineBundle configuration? With Gaufrette a stream wrapper can be configured for that purpose. I found that there is a project that enables stream wrappers for Flysystem filesystems (https://github.com/twistor/flysystem-stream-wrapper/).

@sheeep
Copy link
Contributor

sheeep commented May 29, 2015

Hi @Sander-Toonen

I like the idea to include the possibility for stream wrapper support and therefore started to work on this.
You can find it in the feature-stream_wrapper branch.

It is possible to configure a stream wrapper per filesystem config entry. It is however not yet registered.
The main problem I faced while implementing was finding the place to call FlysystemStreamWrapper::register. I think we can not add it to the extension, as it will not be executed, once the container is compiled. IIRC, the only solution would be to put it in a kernel.init event. Any idea?

@sheeep sheeep self-assigned this May 29, 2015
@Sander-Toonen
Copy link
Author

Is there such a thing as the kernel.init event? You could hook into kernel.request but that wouldn't cover console commands and custom scripts.

Another option would be to implement the boot() function of the bundle class. The bundle class is container aware thus it should be able to use the configuration from there.

@sheeep
Copy link
Contributor

sheeep commented May 29, 2015

Whoops, you're right. There is no such thing as a kernel.init event apparently. Isn't the boot method already executed, when the container is compiled?

@Sander-Toonen
Copy link
Author

The boot method of the bundle is executed every time the boot method of the kernel is called (whether the container gets compiled or not). If the container needs to be compiled, this is done before the execution of the bundles boot methods.

@jonny-no1
Copy link
Contributor

+1 for this feature

@apsylone
Copy link

+1

@Sander-Toonen
Copy link
Author

@bytehead There is a pull request and it looks good. Anything we can do to get this feature merged?

@bytehead
Copy link
Member

Hi @Sander-Toonen, did you already test the PR?

@Sander-Toonen
Copy link
Author

@bytehead Yes, I've tested it by replacing KnpGaufretteBundle by OneupFlysystemBundle + this PR in a project that uses stream wrappers in several places and in multiple ways. I only found one edge case problem that causes stream wrappers to be registered twice when executing the cache:clear command. This however probably needs to be resolved in twistor/flysystem-stream-wrapper. I'll report that issue there.

I have confidence enough in this PR to run it in production but a look from someone with some more knowledge on this bundle certainly wouldn't hurt.

@bytehead
Copy link
Member

bytehead commented Nov 3, 2016

Implemented via #112.

@bytehead bytehead closed this as completed Nov 3, 2016
@bytehead
Copy link
Member

bytehead commented Nov 3, 2016

Thank you @Sander-Toonen for your feature request!

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

No branches or pull requests

5 participants