CoreFiles by mySites.guru
provider.php49 lines, 1,451 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
2bb8394fb33be22a832b060e68b12a22
sha1
39ad2f4aa5e580f2411ca66ab791e79261dc3fd1
sha256
4884ff826b17d768e3f73904fcc28f95951b3e7044388893b7be9bda868a4a6b
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Finder.categories
 *
 * @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\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Finder\Categories\Extension\Categories;

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) {
                $dispatcher = $container->get(DispatcherInterface::class);
                $plugin     = new Categories(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('finder', 'categories')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

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