Files
jmiller 5a498cf3f6
Universal: Auto Version Bump / Version Bump (push) Successful in 13s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 15s
feat: initial scaffold with component, system plugin, and webservices plugin
2026-06-27 20:17:43 +00:00

42 lines
1.6 KiB
PHP

<?php
/**
* @copyright Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
* @license GPL-3.0-or-later
* @author Moko Consulting
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\Extension\MVCComponent;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
use Joomla\CMS\Extension\Service\Provider\RouterFactory;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\CMS\Component\Router\RouterFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
return new class () implements ServiceProviderInterface {
public function register(Container $container): void
{
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Moko\\Component\\MokoSuiteField'));
$container->registerServiceProvider(new MVCFactory('\\Moko\\Component\\MokoSuiteField'));
$container->registerServiceProvider(new RouterFactory('\\Moko\\Component\\MokoSuiteField'));
$container->set(
ComponentInterface::class,
function (Container $container) {
$component = new MVCComponent();
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
$component->setDispatcherFactory($container->get(ComponentDispatcherFactoryInterface::class));
$component->setRouterFactory($container->get(RouterFactoryInterface::class));
return $component;
}
);
}
};