<commit_before><?php
if (!defined('SERVER_ROOT')) {
	header('/error_404');
	exit ;
}

class MURL {

	public static function domain() {
		$uri = explode('.', $_SERVER['SERVER_NAME']);

		$ext = $uri[count($uri) - 1];
		$domain = $uri[count($uri) - 2];
		return $domain . '.' . $ext;

	}

	public static function base() {
		return 'http://' . $_SERVER['SERVER_NAME'];
	}

	public static function current() {
		return 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
	}

	public static function segment($segment) {
		$uri = explode('/', $_SERVER['REQUEST_URI']);

		if (!empty($uri[$segment])) {
			return MString::sub_before($uri[$segment], '?');
		} else {
			return NULL;
		}
	}

	public static function curl($url) {
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$data = curl_exec($ch);
		curl_close($ch);
		return $data;
	}

}<commit_msg>Added a protocol function to MURL.<commit_after><?php
if (!defined('SERVER_ROOT')) {
	header('/error_404');
	exit ;
}

class MURL {

	public static function protocol() {

		$protocol = 'http';

		if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {

			$protocol = 'https';

		}
		
		return $protocol;

	}

	public static function domain() {

		$uri = explode('.', $_SERVER['SERVER_NAME']);

		$ext = $uri[count($uri) - 1];
		$domain = $uri[count($uri) - 2];
		return $domain . '.' . $ext;

	}

	public static function base() {

		return self::protocol() . '://' . $_SERVER['SERVER_NAME'];

	}

	public static function current() {

		return self::protocol() . '://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

	}

	public static function segment($segment) {

		$uri = explode('/', $_SERVER['REQUEST_URI']);

		if (!empty($uri[$segment])) {

			return MString::sub_before($uri[$segment], '?');

		} else {

			return NULL;

		}

	}

	public static function curl($url) {

		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$data = curl_exec($ch);
		curl_close($ch);
		return $data;

	}

}
{'fraction_non_alphanumeric': 0.20452358036573628, 'fraction_numerical': 0.005774783445620789, 'mean_word_length': 3.9033018867924527, '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': '2474822', 'n_tokens_mistral': 824, 'n_tokens_neox': 718, 'n_words': 157}