There are some tools we can provide to help getting web applications deployed a little quicker, and that's what this PR provides.
Item 1 - A controller resolver. In 1.x this really didn't make sense to need because the router was coded in a way where a controller had to map to a Joomla\Controller\ControllerInterface implementation, that requirement is removed in the 2.0 code and controllers can now be any kind of callable. Based loosely on the resolver in Symfony's HttpKernel component, our implementation can support:
Any invokable object (i.e. a Closure or a class with __invoke
A standard callback array (i.e. [ControllerInterface::class, 'execute']
Any declared PHP function
A class name if the class implements Joomla\Controller\ControllerInterface
Via an optional subclass, a controller defined as a service in any PSR-11 compatible container
Item 2 - A concrete web application. The basics of our web application are to route the request and execute a controller. Without a controller resolver, it has never made sense to have a concrete application because downstream implementations were left to handle controller resolution and execution on their own. With the resolver, we can now ship this concrete implementation fulfilling these basic functions.
Testing Instructions
Review unit tests for basic use of these two features
Documentation Changes Required
A "getting started" guide can be much more simple now 😄
Summary of Changes
Note: Requires https://github.com/joomla-framework/router/pull/12 and CI will fail without it
There are some tools we can provide to help getting web applications deployed a little quicker, and that's what this PR provides.
Item 1 - A controller resolver. In 1.x this really didn't make sense to need because the router was coded in a way where a controller had to map to a
Joomla\Controller\ControllerInterface
implementation, that requirement is removed in the 2.0 code and controllers can now be any kind of callable. Based loosely on the resolver in Symfony's HttpKernel component, our implementation can support:__invoke
[ControllerInterface::class, 'execute']
Joomla\Controller\ControllerInterface
Item 2 - A concrete web application. The basics of our web application are to route the request and execute a controller. Without a controller resolver, it has never made sense to have a concrete application because downstream implementations were left to handle controller resolution and execution on their own. With the resolver, we can now ship this concrete implementation fulfilling these basic functions.
Testing Instructions
Review unit tests for basic use of these two features
Documentation Changes Required
A "getting started" guide can be much more simple now 😄