CoreFiles by mySites.guru
provider.php48 lines, 1,342 bytes, from Joomla_5.0.2-Stable-Full_Package.zip
Raw History Compare with 5.0.1
md5
7c589c8d34d828a179119962c2410ce8
sha1
7281f1355c0ff547bfb9f56ed6d4f9d91c05d0e4
sha256
dd3764e8bf45491029c1ed7c45872dab752991e4464af647cf92361dba3a42ff
<?php

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

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

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