CoreFiles by mySites.guru
provider.php49 lines, 1,308 bytes, from Joomla_5.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta1
md5
9a8c9632f66ceb3b46f42b25bc1b67dd
sha1
5de05a1339bc74e5c4bcc1585c5ae95d5d33f318
sha256
21250672bccd71c87bd4617c8d5d61722a3b77b616b7f98664cab5f0a1978582
<?php

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

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

                $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.