CoreFiles by mySites.guru
provider.php48 lines, 1,398 bytes, from Joomla_4.4.6-Stable-Full_Package.zip
Raw History Compare with 4.4.5
md5
973e4f35060cff7473253a0aafcf728a
sha1
1583378ee0804075fd6af5f41b37525c4ce805e4
sha256
45cb8f62e35a0e1f22dfc83b335d4e91ac1994fb273addd84bf41580b1881828
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.httpheaders
 *
 * @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\System\Httpheaders\Extension\Httpheaders;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.4.0
     */
    public function register(Container $container): void
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $plugin     = new Httpheaders(
                    $container->get(DispatcherInterface::class),
                    (array) PluginHelper::getPlugin('system', 'httpheaders'),
                    Factory::getApplication()
                );
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

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