<commit_before><?php
if (!defined('NL')) define ('NL', "\n");

require_once ('MF/Exception/Handler.php');

class MF_Loader_AutoLoad {
	private static $exceptions = true;
	private static $namespaces;
	
	public static function autoload ($class) {
		$autoload = true;
		
		if (!empty(self::$namespaces)) {
			$autoload = false;
			foreach (self::$namespaces as $namespace) {
				if (substr($class, 0, strlen($namespace)) == $namespace) {
					$autoload = true;
					break;
				}
			}
		}
		
		if ($autoload) {
			try {
				$file = str_replace('_', '/', $class).'.php';
				@include_once($file);
				
			    if (!class_exists($class, false) && !interface_exists($class, false)) {
			    	if (self::$exceptions) {
						throw (new Exception(MF_EXCEPTION_CLASS_NOT_FOUND));
			    	}
			    }
		    }
		    catch (Exception $e) {
		    	MF_Exception_Handler::getInstance()->handle($e);
		    }
		}
	}
	
	public static function register ($args = array()) {
		if (isset($args['exceptions'])) {
			self::$exceptions = $args['exceptions'];
		}
		if (isset($args['namespaces'])) {
			self::$namespaces = array();
			foreach($args['namespaces'] as $namespace) {
				self::$namespaces[] = str_replace('/', '_', $namespace);
			}
		}
		
		if (isset($args['__autoload']) && ($args['__autoload'])) {
			function __autoload ($class) {
				MF_Loader_AutoLoad::autoload($class);
			}
		}
		else {
			spl_autoload_register(array('MF_Loader_AutoLoad', 'autoload'), true, true);
		}
	}
}
<commit_msg>added PHP Version check on AutoLoad<commit_after><?php
if (!defined('NL')) define ('NL', "\n");

require_once ('MF/Exception/Handler.php');

class MF_Loader_AutoLoad {
	private static $exceptions = true;
	private static $namespaces;
	
	public static function autoload ($class) {
		$autoload = true;
		
		if (!empty(self::$namespaces)) {
			$autoload = false;
			foreach (self::$namespaces as $namespace) {
				if (substr($class, 0, strlen($namespace)) == $namespace) {
					$autoload = true;
					break;
				}
			}
		}
		
		if ($autoload) {
			try {
				$file = str_replace('_', '/', $class).'.php';
				@include_once($file);
				
			    if (!class_exists($class, false) && !interface_exists($class, false)) {
			    	if (self::$exceptions) {
						throw (new Exception(MF_EXCEPTION_CLASS_NOT_FOUND));
			    	}
			    }
		    }
		    catch (Exception $e) {
		    	MF_Exception_Handler::getInstance()->handle($e);
		    }
		}
	}
	
	public static function register ($args = array()) {
		if (isset($args['exceptions'])) {
			self::$exceptions = $args['exceptions'];
		}
		if (isset($args['namespaces'])) {
			self::$namespaces = array();
			foreach($args['namespaces'] as $namespace) {
				self::$namespaces[] = str_replace('/', '_', $namespace);
			}
		}
		
		if ( (isset($args['__autoload']) && ($args['__autoload'])) || (version_compare(PHP_VERSION, '5.1.2', '<')) ) {
			function __autoload ($class) {
				MF_Loader_AutoLoad::autoload($class);
			}
		}
		else {
			if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
				spl_autoload_register(array('MF_Loader_AutoLoad', 'autoload'), true, true);
			} else {
				spl_autoload_register(array('MF_Loader_AutoLoad', 'autoload'));
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.1806314511232544, 'fraction_numerical': 0.0024286581663630845, 'mean_word_length': 2.993939393939394, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '78007', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1100, 'n_words': 199}