CoreFiles by mySites.guru
provider.php47 lines, 1,351 bytes, from Joomla_5.0.3-Stable-Full_Package.zip
Raw History Compare with 5.0.2
md5
5519df6afdcdf5d696adecfe337b0d59
sha1
e34612de5b1578d5ad37f2ba5d021fe60821180a
sha256
37ac688ec251bfb48d211cc75d346ae9fb6495ed910e7dfdbbb6f3daa0e9c479
<?php

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

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 Organization(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('schemaorg', 'organization')
                );
                $plugin->setApplication(Factory::getApplication());

                return $plugin;
            }
        );
    }
};

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