<commit_before><?php

/**
 * Definition of the dts.federation object responsible for exposing data about
 * the federated "central" host to which all device telemetry should be 
 * offloaded.
 * 
 * @author      <NAME>
 * @copyright   Copyright (c) 2011-12 UC Regents
 * @license     BSD
 * @version     20120131
 */

$domain = 'localhost';
$script = 'dts/www/passthru.php';

echo 'dts.federation = { '
        .'domain:"'.$domain.'", '
        .'script:"'.$script.'"};';<commit_msg>Set default domain for dts.federation<commit_after><?php

/**
 * Definition of the dts.federation object responsible for exposing data about
 * the federated "central" host to which all device telemetry should be 
 * offloaded.
 * 
 * @author      <NAME>
 * @copyright   Copyright (c) 2011-12 UC Regents
 * @license     BSD
 * @version     20120131
 */

$domain = $_SERVER['HTTP_HOST'];

if(($i = strpos($domain, '://')) !== false)
    $domain = substr($domain, $i+3);
elseif(substr($domain, 0, 2) == '//')
    $domain = substr($domain, 2);

if(($i = strpos($domain, '/')) !== false)
    $domain = substr($domain, $i);

if(($i = strpos($domain, ':')) !== false)
    $domain = substr($domain, $i);

if(substr($domain, 0, 1) == '.')
    $domain = substr($domain, 1);

$script = 'dts/www/passthru.php';

echo 'dts.federation = { '
        .'domain:"'.$domain.'", '
        .'script:"'.$script.'"};';
{'fraction_non_alphanumeric': 0.19434372733865118, 'fraction_numerical': 0.025380710659898477, 'mean_word_length': 3.2990654205607477, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '621457', 'n_tokens_mistral': 498, 'n_tokens_neox': 459, 'n_words': 119}