CoreFiles by mySites.guru
provider.php48 lines, 1,316 bytes, from Joomla_5.0.0-beta3-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta2
md5
b53e0e17d997a0454990c494095b65ed
sha1
5bc7a4fe70e5194ff7db6987cf61f8448025e291
sha256
1316f3501b5c42fb0a3c4b26f463ceedeb59ff2414cddbb7b2768e0a7b6c0eaf
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Schemaorg.event
 *
 * @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\Schemaorg\Event\Extension\Event;

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

                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

The same content is in 5 releases, Joomla 5.0.0-alpha3 to 5.0.0-beta3. See them all, or every version of this file.