CoreFiles by mySites.guru
ModuleDispatcher.php59 lines, 1,167 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
13ce8d0382f9869e7573d15ad87412b1
sha1
cfa153f14897c56a70cc33b9e08bf86b99d4d4b8
sha256
489c7a2f108eda61b601872ef52e91300e77f696ef9aa07c1c89b658c70858a2
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Dispatcher;

\defined('_JEXEC') or die;

/**
 * Base class for a Joomla Module Dispatcher
 *
 * Executes the single entry file of a module.
 *
 * @since  4.0.0
 */
class ModuleDispatcher extends AbstractModuleDispatcher
{
	/**
	 * Dispatches the dispatcher.
	 *
	 * @return  void
	 *
	 * @since   4.0.0
	 */
	public function dispatch()
	{
		$path = JPATH_BASE . '/modules/' . $this->module->module . '/' . $this->module->module . '.php';

		if (!is_file($path))
		{
			return;
		}

		$this->loadLanguage();

		// Execute the layout without the module context
		$loader = static function ($path, array $displayData)
		{
			// If $displayData doesn't exist in extracted data, unset the variable.
			if (!\array_key_exists('displayData', $displayData))
			{
				extract($displayData);
				unset($displayData);
			}
			else
			{
				extract($displayData);
			}

			include $path;
		};

		$loader($path, $this->getLayoutData());
	}
}

No other release has this exact content. See every version of this file.