CoreFiles by mySites.guru
provider.php48 lines, 1,437 bytes, from Joomla_6.0.3-Stable-Full_Package.zip
Raw History Compare with 6.0.2
md5
0560e3a7f167bc2375314b8cb7092944
sha1
960f6e89c054fcb93897996784de0b3f74d7b7bf
sha256
0b9a9a3dbc327bdc744abc89f5a1103361176d97e0c0157b938b838d36793e78
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.actionlogs
 *
 * @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\CMS\User\UserFactoryInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Plugin\System\ActionLogs\Extension\ActionLogs;

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 ActionLogs(
                    (array) PluginHelper::getPlugin('system', 'actionlogs')
                );
                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase($container->get(DatabaseInterface::class));
                $plugin->setUserFactory($container->get(UserFactoryInterface::class));

                return $plugin;
            }
        );
    }
};

The same content is in 43 releases, Joomla 5.4.0-beta2 to 6.1.0-alpha3. See them all, or every version of this file.