CoreFiles by mySites.guru
ModuleDispatcher.php59 lines, 1,154 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
ba8761d0bf2cbe3ddfbe07c549a9a4ef
sha1
3fa3cb23c6aff4708c6f3105a1ad7b554b0937ff
sha256
f85f737f8951d80ad46ec9efd9a478e504bc186461b1b42a24bb17ec44dc4bba
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @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());
	}
}

The same content is in 51 releases, Joomla 4.0.0-beta6 to 4.2.0-beta2. See them all, or every version of this file.