CoreFiles by mySites.guru
provider.php46 lines, 1,334 bytes, from Joomla_6.1.2-Stable-Full_Package.zip
Raw History Compare with 6.1.1
md5
c22c327f8676fb3342581d2a1b94d107
sha1
b207f64a40119b16dd90c7276d01a870bb94b4f6
sha256
946d9be2dafb49ee2741bb829e1a0796be6b350454f7a40fed529b9e013ca33c
<?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\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,
            $container->lazy(Httpheaders::class, function (Container $container) {
                $plugin     = new Httpheaders(
                    (array) PluginHelper::getPlugin('system', 'httpheaders'),
                    Factory::getApplication()
                );
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 28 releases, Joomla 6.1.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.