CoreFiles by mySites.guru
provider.php46 lines, 1,319 bytes, from Joomla_6.1.2-Stable-Full_Package.zip
Raw History Compare with 6.1.1
md5
584ce06e4f88c1d3f2bdd8c1bec4cd6a
sha1
58b7efb23c838dba40d363a8b914239b13c9d9e6
sha256
1aa54f3786096898f0e0dd15cc9d44c67c8bc706aa9e96a965b0afb816293122
<?php

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

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(Stats::class, function (Container $container) {
                $plugin     = new Stats(
                    (array) PluginHelper::getPlugin('system', 'stats')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));

                return $plugin;
            })
        );
    }
};

The same content is in 19 releases, Joomla 6.1.0-beta1 to 6.2.0-alpha1. See them all, or every version of this file.