joomla-oauth-server/plg_system_oauthserver/services/provider.php

36 lines
1008 B
PHP
Raw Permalink Normal View History

2024-03-02 04:44:33 +03:00
<?php
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;
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 {
/**
* @param \Joomla\DI\Container $container
* @return void
* @since version
*/
public function register(Container $container)
2024-03-02 04:44:33 +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
}
};