<commit_before><?php
# auto-detecting showslow_root (path) and showslow_base (URL)
$showslow_root = dirname(__FILE__).'/';

# function to generate URL from current showslow_root
function getShowSlowBase() {
	global $showslow_root;

	// Chopping of trailing slash which is not supposed to be there in Apache config
	// See: http://httpd.apache.org/docs/2.0/mod/core.html#documentroot
	$docroot = $_SERVER['DOCUMENT_ROOT'];
	if (substr($docroot, -1) == '/') {
		$docroot = substr($docroot, 0, -1);
	}

	$docrootlength = strlen($docroot);

	if (array_key_exists('HTTP_HOST', $_SERVER))
	{
		$host = $_SERVER['HTTP_HOST'];
	}
	else
	{
		$host = gethostname();
		// if not running from command line, send warning to the log file
		if (php_sapi_name() !== 'cli') {
			error_log("[ShowSlow config] Warning: Can't determine site's host name, using $host");
		}
	}

	$protocol = 'http';
	if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'HTTPS') {
		$protocol = 'https';
	}

	return $protocol.'://'.$host.substr($showslow_root, $docrootlength);<commit_msg>Replacing gethostname() with php_uname('n') to avoid 5.3.0 dependency.<commit_after><?php
# auto-detecting showslow_root (path) and showslow_base (URL)
$showslow_root = dirname(__FILE__).'/';

# function to generate URL from current showslow_root
function getShowSlowBase() {
	global $showslow_root;

	// Chopping of trailing slash which is not supposed to be there in Apache config
	// See: http://httpd.apache.org/docs/2.0/mod/core.html#documentroot
	$docroot = $_SERVER['DOCUMENT_ROOT'];
	if (substr($docroot, -1) == '/') {
		$docroot = substr($docroot, 0, -1);
	}

	$docrootlength = strlen($docroot);

	if (array_key_exists('HTTP_HOST', $_SERVER))
	{
		$host = $_SERVER['HTTP_HOST'];
	}
	else
	{
		$host = php_uname('n');
		// if not running from command line, send warning to the log file
		if (php_sapi_name() !== 'cli') {
			error_log("[ShowSlow config] Warning: Can't determine site's host name, using $host");
		}
	}

	$protocol = 'http';
	if (array_key_exists('HTTPS', $_SERVER) && $_SERVER['HTTPS'] == 'HTTPS') {
		$protocol = 'https';
	}

	return $protocol.'://'.$host.substr($showslow_root, $docrootlength);
{'fraction_non_alphanumeric': 0.1681943171402383, 'fraction_numerical': 0.005957836846929423, 'mean_word_length': 4.67012987012987, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1238459', 'n_tokens_mistral': 815, 'n_tokens_neox': 766, 'n_words': 190}