CoreFiles by mySites.guru
provider.php47 lines, 1,319 bytes, from Joomla_4.3.0-beta1-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta3
md5
9c2ab6a84e0ea8238675a16f8c4e5fcf
sha1
e5c0c0cff9476df2c31ef2f7225873eba09a42a9
sha256
695177f9633a69adabad4e70fd2dfb271bd33650663781f926a1898bcc6fc221
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.media
 *
 * @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\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\Fields\Media\Extension\Media;

return new class () implements ServiceProviderInterface {
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   __DEPLOY_VERSOIN__
     */
    public function register(Container $container)
    {
        $container->set(
            PluginInterface::class,
            function (Container $container) {
                $dispatcher = $container->get(DispatcherInterface::class);
                $plugin     = new Media(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('fields', 'media')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 2 releases, Joomla 4.3.0-beta1 to 4.3.0-beta2. See them all, or every version of this file.