<commit_before><?php

class Utility {

  public static function displayError($message) {

    // Clear the buffer.
    ob_end_clean();

    // Terminate with an error message.
    exit("Error: {$message}.");
  }

  public static function getRootAddress() {

    $host = $_SERVER["HTTP_HOST"];

    $protocol = "http://";

    $sub_directory = substr(

      dirname(dirname(__DIR__)),

      strlen($_SERVER["DOCUMENT_ROOT"])
    );

    // Get absolute URL of where Kaku is installed.
    return $protocol . $host . $sub_directory;
  }
}

?><commit_msg>Get server protocol dynamically<commit_after><?php

class Utility {

  public static function displayError($message) {

    // Clear the buffer.
    ob_end_clean();

    // Terminate with an error message.
    exit("Error: {$message}.");
  }

  public static function getRootAddress() {

    $host = $_SERVER["HTTP_HOST"];

    $protocol = $_SERVER["SERVER_PROTOCOL"];

    $protocol =  strtolower(substr($protocol, 0, strpos($protocol, "/")));

    $protocol .= "://";

    $sub_directory = substr(

      dirname(dirname(__DIR__)),

      strlen($_SERVER["DOCUMENT_ROOT"])
    );

    // Get absolute URL of where Kaku is installed.
    return $protocol . $host . $sub_directory;
  }
}

?>
{'fraction_non_alphanumeric': 0.14779116465863454, 'fraction_numerical': 0.0008032128514056225, 'mean_word_length': 2.9935897435897436, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 5, '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': '3281518', 'n_tokens_mistral': 391, 'n_tokens_neox': 366, 'n_words': 92}