CoreFiles by mySites.guru
debug.php71 lines, 1,518 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
f9a7d55f5b1f30919402966123909cef
sha1
d19628d93a3cec4f7f294b5778de813621d48276
sha256
95b004979b26f715be1dfe861ee5ba9ece72c2fae73b4c41c660ab6c5981d43a
<?php
/**
 * @package     Joomla.Libraries
 * @subpackage  HTML
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\HTML\HTMLHelper;

/**
 * Extended Utility class for render debug information.
 *
 * @since  3.7.0
 */
abstract class JHtmlDebug
{
	/**
	 * xdebug.file_link_format from the php.ini.
	 *
	 * Make this property public to support test.
	 *
	 * @var    string
	 *
	 * @since  3.7.0
	 */
	public static $xdebugLinkFormat;

	/**
	 * Replaces the Joomla! root with "JROOT" to improve readability.
	 * Formats a link with a special value xdebug.file_link_format
	 * from the php.ini file.
	 *
	 * @param   string  $file  The full path to the file.
	 * @param   string  $line  The line number.
	 *
	 * @return  string
	 *
	 * @throws  \InvalidArgumentException
	 *
	 * @since   3.7.0
	 */
	public static function xdebuglink($file, $line = '')
	{
		if (static::$xdebugLinkFormat === null)
		{
			static::$xdebugLinkFormat = ini_get('xdebug.file_link_format');
		}

		$link = str_replace(JPATH_ROOT, 'JROOT', JPath::clean($file));
		$link .= $line ? ':' . $line : '';

		if (static::$xdebugLinkFormat)
		{
			$href = static::$xdebugLinkFormat;
			$href = str_replace('%f', $file, $href);
			$href = str_replace('%l', $line, $href);

			$html = HTMLHelper::_('link', $href, $link);
		}
		else
		{
			$html = $link;
		}

		return $html;
	}
}

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