CoreFiles by mySites.guru
provider.php50 lines, 1,705 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
baf99a694cdff995155cc9cb079e5640
sha1
233908c7ce9c618b4da7b988f6e897b88f1aeff0
sha256
f4b96fa4f495f6fdcab94b7f192d99210872075599db1f9e2bd1fc7ac78dd2ea
<?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\Language\LanguageFactoryInterface;
use Joomla\CMS\Mail\MailerFactoryInterface;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\User\UserFactoryInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
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,
            $container->lazy(Email::class, function (Container $container) {
                $plugin = new Email((array) PluginHelper::getPlugin('multifactorauth', 'email'));
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));
                $plugin->setUserFactory($container->get(UserFactoryInterface::class));
                $plugin->setMailerFactory($container->get(MailerFactoryInterface::class));
                $plugin->setLanguageFactory($container->get(LanguageFactoryInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 6 releases, Joomla 6.2.0-beta2 to 6.2.1-rc1. See them all, or every version of this file.