CoreFiles by mySites.guru
Menu.php51 lines, 1,478 bytes, from Joomla_4.2.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta2
md5
3145009155931d0cae5d4f4de46aee3d
sha1
408ca55b6f6dcb67753ba3fd18ed8309583075e6
sha256
7dfb4d29e70494f3d0ad092c4a98c4f2972025eb5982d6094c215d0bb3f5e052
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Service\Provider;

use Joomla\CMS\Cache\CacheControllerFactoryInterface;
use Joomla\CMS\Menu\MenuFactory;
use Joomla\CMS\Menu\MenuFactoryInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the application's menu dependency
 *
 * @since  4.0.0
 */
class Menu implements ServiceProviderInterface
{
    /**
     * Registers the service provider with a DI container.
     *
     * @param   Container  $container  The DI container.
     *
     * @return  void
     *
     * @since   4.0.0
     */
    public function register(Container $container)
    {
        $container->alias('menu.factory', MenuFactoryInterface::class)
            ->alias(MenuFactory::class, MenuFactoryInterface::class)
            ->share(
                MenuFactoryInterface::class,
                function (Container $container) {
                    $factory = new MenuFactory();
                    $factory->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class));
                    $factory->setDatabase($container->get(DatabaseInterface::class));

                    return $factory;
                },
                true
            );
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.