As discussed in JAB17 we need a plan for the helper classes. At the moment they have the same setup as on J3 and are resting in the root namespace. These classes are mostly magically compiled somewhere outside of the extension itself. For example here is the Helper class of the component loaded and checked if the function exists. We need to have a look case by case how we want to solve it.
There are different ways to achieve that, we were discussing the following approaches:
I add here a todo list of known cases where we need to find a solution for:
The list is by for not complete, the plan is to constantly extend it.
Labels |
Added:
?
|
Category | ⇒ | Components |
use Joomla\CMS\Association\AssociationExtensionInterface;
use Joomla\CMS\Categories\Categories;
use Joomla\CMS\Component\Router\RouterInterface;
use Joomla\CMS\Dispatcher\DispatcherInterface;
interface ComponentContainer
{
/*
* @return AssociationExtensionInterface|null
* @todo Should support for this be in a separate interface?
* @throws UnsupportedFeatureException
*/
public function getAssociations(): ?AssociationExtensionInterface;
/*
* @return Categories|null
* @todo Should support for this be in a separate interface?
* @throws UnsupportedFeatureException
*/
public function getCategories(): ?Categories;
/*
* @return DispatcherInterface
* @todo This implies a component doesn't support 3.x structure, is this OK? I'm not aware of there being a legacy dispatcher implementation similar to the MVC LegacyFactory.
*/
public function getDispatcher(): DispatcherInterface;
/*
* @return RouterInterface|null
* @todo Should support for this be in a separate interface? Not all components have frontend routing, i.e. com_contenthistory
* @throws UnsupportedFeatureException
*/
public function getRouter(): ?RouterInterface;
}
You mean that's basically the return value of the boot function?
Another question which arises, should not every extension be bootable, especially plugins?
The object that gets created by the boot function IMO should have that interface.
For now I would focus primarily on components here. Going back to the Symfony bundle and Laravel package comparison, our components fit that role and I'd use that extension type to sort things out first. Then we can work out what changes are needed to do something similar for modules, plugins, templates, etc.
Status | New | ⇒ | Discussion |
Labels |
Added:
J4 Issue
|
Closing this one as the identified services are migrated to the component set up.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-05-10 12:55:00 |
Closed_By | ⇒ | laoneo |
Adding here comments what we do discus in the meeting:
Keys:
Legacy container which loads categories and associations the old way.