CoreFiles by mySites.guru
provider.php49 lines, 1,455 bytes, from Joomla_5.2.6-Stable-Full_Package.zip
Raw History Compare with 5.2.5
md5
b3cd4b9979798f70c725cd7bb9806638
sha1
09ec70caf09c9a7a0a63462cc5f49f54c9e9af94
sha256
467e4fcac405718c934a0d3a10c2796c8a71445c9f9223e511aa042690644bfb
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Quickicon.Joomlaupdate
 *
 * @copyright   (C) 2019 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\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Quickicon\Joomlaupdate\Extension\Joomlaupdate;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                // @Todo This needs to be changed to a proper factory
                $plugin = \Joomla\CMS\Plugin\PluginHelper::getPlugin('quickicon', 'joomlaupdate');

                $plugin = new Joomlaupdate(
                    $container->get(DispatcherInterface::class),
                    Factory::getApplication()->getDocument(),
                    (array) $plugin
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 77 releases, Joomla 5.0.0-rc to 6.0.0-beta1. See them all, or every version of this file.