2026-05-23 17:10:17 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
2026-05-30 19:03:10 -05:00
|
|
|
* @package MokoJoomOpenGraph
|
2026-05-23 17:10:17 -05:00
|
|
|
* @subpackage com_mokoog
|
|
|
|
|
* @author Moko Consulting <hello@mokoconsulting.tech>
|
|
|
|
|
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
|
|
|
|
* @license GNU General Public License version 3 or later; see LICENSE
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
|
|
|
|
|
|
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
|
|
|
|
|
use Joomla\CMS\Extension\ComponentInterface;
|
|
|
|
|
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
|
|
|
|
|
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
|
|
|
|
|
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
|
|
|
|
|
use Joomla\Component\MokoOG\Administrator\Extension\MokoOGComponent;
|
|
|
|
|
use Joomla\DI\Container;
|
|
|
|
|
use Joomla\DI\ServiceProviderInterface;
|
|
|
|
|
|
|
|
|
|
return new class () implements ServiceProviderInterface {
|
|
|
|
|
/**
|
|
|
|
|
* Register the service provider.
|
|
|
|
|
*
|
|
|
|
|
* @param Container $container The DI container
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function register(Container $container): void
|
|
|
|
|
{
|
|
|
|
|
$container->registerServiceProvider(new MVCFactory('\\Joomla\\Component\\MokoOG'));
|
|
|
|
|
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Joomla\\Component\\MokoOG'));
|
|
|
|
|
|
|
|
|
|
$container->set(
|
|
|
|
|
ComponentInterface::class,
|
|
|
|
|
function (Container $container) {
|
|
|
|
|
$component = new MokoOGComponent(
|
|
|
|
|
$container->get(ComponentDispatcherFactoryInterface::class)
|
|
|
|
|
);
|
|
|
|
|
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
|
|
|
|
|
|
|
|
|
|
return $component;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
};
|