Closed acgrid closed 8 years ago
About your suggestions:
Yeah you reminded me, suggestion 2 may be awful with different constructor signature.
Then it seems that the first option is most straightforward, so I also want to question "Is there any reason this property is private?"
I recommend just writing creating instantiating your own request and response objects and calling $app->__invoke() directly.
Thanks for your reply. I've edited my code to avoid subRequest()
and no impacts so far.
I want use my own
Request
implementation by registering the factory before Slim's default service provider.However the
Slim\App::subRequest()
breaks everything because it instantiateSlim\Http\Request
in literal and more worse, I can not override this method since its private field$container
.Suggestions I can come up with:
Slim\App::$container
protected to allow inheritance.get_class()
on request object in container.Reference: https://github.com/slimphp/Slim/blob/184352bc1913d7ba552ab4131d62f4730ddb0893/Slim/App.php#L495