CoreFiles by mySites.guru
provider.php49 lines, 1,309 bytes, from Joomla_5.0.3-Stable-Full_Package.zip
Raw History Compare with 5.0.2
md5
24fff9cfd8767c7547127bcff759ea12
sha1
2f64a396794c6a42f6dab125355150e2f04fc6b5
sha256
3ed2843610368ff2a0267a3d860ba2eca23773935071a0b36d9fa4a9bc377aa2
<?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 16 releases, Joomla 5.0.0-rc to 5.1.0-beta1. See them all, or every version of this file.