What is the proper way to use OutputBufferingMiddleware with Slim 4?
I tried using bothsnippets I found in the docs, but neither one of them appears to be working.
It appears I need to pass a StreamFactory to the middleware, but I can’t figure out where to get one from.
The update guide’s snippet is missing the StreamFactory.
In my case I was using the Nyholm PSR7, mostly because according to the Nyholm PSR7 readme, Slim’s psr 7 implementation didn’t pass all integration tests while Nyholm did (though I suppose that information could be outdated by now).
Anyways, I was under the impression that Slim intended to abstract away the differences between different supported PSR7 implementations. Do I understand correctly that Slim doesn’t expose some utility to easily get a StreamFactory regardless of which of the supported PSR7 implementations are in use? I’m new to this PSR7 thing, so I’m not yet sure if it makes much sense to expect such a feature or not.
Anyways, I’ll go and figure out how to get at Nyholm’s stream factory.
Anyways, I was under the impression that Slim intended to abstract away the differences between different supported PSR7 implementations
That’s correct. In Slim 4 the PSR-7 implementation is decoupled from the App core. This means you can also install other PSR-7 implementations like Nyholm.
Do I understand correctly that Slim doesn’t expose some utility to easily get a StreamFactory regardless of which of the supported PSR7 implementations are in use?