CoreFiles by mySites.guru
WebAsset.php55 lines, 1,324 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
506b782aeba7fb009388f1097e749632
sha1
8e7ceaac18ee06c7bb089cd072feb22666375da9
sha256
3ed3d8536b14f53f470ec40b9dfe8954de2844755298eca3841643bb8446f415
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2018 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;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

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

					// Set up Dispatcher
					$registry->setDispatcher($container->get('Joomla\Event\DispatcherInterface'));

					// 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 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.