CoreFiles by mySites.guru
provider.php51 lines, 1,457 bytes, from Joomla_5.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha2
md5
004b58e406e53e5fc09313093cedde55
sha1
b4f1d5b7eedeb96d189dd3b75ccbc6252b58964d
sha256
69da13c72426405ced825aff10d52b47b16ac70c90f2d68dedd157cb42476a40
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  System.schemaorg
 *
 * @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\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\Plugin\System\Schemaorg\Extension\Schemaorg;

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 Schemaorg(
                    $dispatcher,
                    (array) PluginHelper::getPlugin('system', 'schemaorg')
                );

                $plugin->setApplication(Factory::getApplication());
                $plugin->setDatabase(Factory::getContainer()->get(DatabaseInterface::class));

                return $plugin;
            }
        );
    }
};

No other release has this exact content. See every version of this file.