2024-03-02 04:44:33 +03:00
|
|
|
<?php
|
|
|
|
|
2024-03-04 01:15:47 +03:00
|
|
|
use Joomla\CMS\Extension\PluginInterface;
|
|
|
|
use Joomla\CMS\Factory;
|
|
|
|
use Joomla\CMS\Plugin\PluginHelper;
|
|
|
|
use Joomla\DI\Container;
|
2024-03-02 04:44:33 +03:00
|
|
|
use Joomla\DI\ServiceProviderInterface;
|
2024-03-04 01:15:47 +03:00
|
|
|
use Joomla\Event\DispatcherInterface;
|
|
|
|
use Webmasterskaya\Plugin\System\OauthServer\Extension\Plugin;
|
2024-03-02 04:44:33 +03:00
|
|
|
|
|
|
|
\defined('_JEXEC') or die;
|
|
|
|
|
|
|
|
return new class implements ServiceProviderInterface {
|
|
|
|
|
2024-03-04 01:15:47 +03:00
|
|
|
/**
|
|
|
|
* @param \Joomla\DI\Container $container
|
|
|
|
* @return void
|
|
|
|
* @since version
|
|
|
|
*/
|
|
|
|
public function register(Container $container)
|
2024-03-02 04:44:33 +03:00
|
|
|
{
|
2024-03-04 01:15:47 +03:00
|
|
|
$container->set(
|
|
|
|
PluginInterface::class,
|
|
|
|
function (Container $container) {
|
|
|
|
$dispatcher = $container->get(DispatcherInterface::class);
|
|
|
|
$plugin = new Plugin(
|
|
|
|
$dispatcher,
|
|
|
|
(array) PluginHelper::getPlugin('system', 'oauthserver')
|
|
|
|
);
|
|
|
|
$plugin->setApplication(Factory::getApplication());
|
|
|
|
|
|
|
|
return $plugin;
|
|
|
|
}
|
|
|
|
);
|
2024-03-02 04:44:33 +03:00
|
|
|
}
|
|
|
|
};
|