CoreFiles by mySites.guru
WebAssetRegistry.php52 lines, 1,217 bytes, from Joomla_4.0.0-alpha8-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha7
md5
effc78c25204a2c0391966975e3fd270
sha1
26b4d7bcd7e15d7231efc1cd0b79f72107d48945
sha256
0cfd5f361f801496ff400465394a19fc35fb20c43b1798e735bc8645711d0305
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Service\Provider;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\WebAsset\WebAssetRegistry as Registry;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

/**
 * Service provider for the application's WebAsset dependency
 *
 * @since  4.0.0
 */
class WebAssetRegistry 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('webassetregistry', Registry::class)
			->share(
				Registry::class,
				function (Container $container)
				{
					$registry = new Registry;

					// Add Core registry files
					$registry->addRegistryFile('media/vendor/joomla.asset.json')
						->addRegistryFile('media/system/joomla.asset.json')
						->addRegistryFile('media/legacy/joomla.asset.json');

					return $registry;
				},
				true
			);
	}
}

The same content is in 5 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha11. See them all, or every version of this file.