CoreFiles by mySites.guru
provider.php48 lines, 1,429 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
2dde1f7126776df4549478b73341b759
sha1
478fd1f4a225e58665bcf87291c2a66895250027
sha256
fef189ab6ff265bb9e5ec23e19893590737b6fd5e8f186110056789c09acd588
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Multifactorauth.email
 *
 * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') || die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Multifactorauth\Email\Extension\Email;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since 4.2.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $config  = (array) PluginHelper::getPlugin('multifactorauth', 'email');
                $subject = $container->get(DispatcherInterface::class);

                $plugin = new Email($subject, $config);
                $plugin->setApplication(Factory::getApplication());
                $plugin->setUserFactory($container->get(UserFactoryInterface::class));

                return $plugin;
            }
        );
    }
};

The same content is in 38 releases, Joomla 4.4.0-alpha1 to 5.0.0-alpha1. See them all, or every version of this file.