CoreFiles by mySites.guru
provider.php48 lines, 1,376 bytes, from Joomla_5.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha2
md5
aa357947d13003cabfad18d685490c7a
sha1
c111dfcae220ec11f51bde9cb62e6ea8c7828820
sha256
5736c105741b2f17f42bb034dfa44e729bf02f4c42bc6d486063253bad76a682
<?php

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

defined('_JEXEC') or die;

use Joomla\CMS\Extension\PluginInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Authentication\Ldap\Extension\Ldap;
use Joomla\Plugin\Authentication\Ldap\Factory\LdapFactory;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.3.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin = new Ldap(
                    new LdapFactory(),
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('authentication', 'ldap')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 6 releases, Joomla 5.0.0-alpha2 to 5.0.0-beta3. See them all, or every version of this file.