CoreFiles by mySites.guru
provider.php48 lines, 1,321 bytes, from Joomla_5.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta1
md5
7277e18c76d30eac5411d13eccf59775
sha1
97a6c141614301006a308c922d2d3f1b62fa1c4e
sha256
b02f388f613eedf43b270c88aa9ef3b270c57c6d8fd7f7d286130825aa727a75
<?php

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

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

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