<commit_before><?php
//Original script (now modified) from: http://jes.st/2011/phpunit-bootstrap-and-autoloading-classes/
//TODO: make this non-static if possible.
/**
 * @codeCoverageIgnore
 */
class AutoLoader {
	 
	static private $classNames = array();
	 
	/**
	* Store the filename (sans extension) & full path of all ".php" files found
	*/
	public static function registerDirectory($dirName) {
		$di = new DirectoryIterator($dirName);
		foreach ($di as $file) {
//crazedsanity\cs_global::debug_print("\t". __METHOD__ .": processing $dirName (". $file->getFilename() .")... ",1);
			 
			if ($file->isDir() && !$file->isLink() && !$file->isDot()) {
				// recurse into directories other than a few special ones
				self::registerDirectory($file->getPathname());
			} 
			elseif (preg_match('~[Aa]bstract\.class~', $file->getFilename())) {
				//cs_version.abstract.class.php becomes "cs_versionAbstract"
				$className = preg_replace('~.abstract.class.php~i', '', $file->getFilename()) . "Abstract";
//crazedsanity\cs_global::debug_print("\t". __METHOD__ .": (". $file->getFilename() .") changed to '". $className ."'",1);
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif (preg_match('~\.abstract\.php~i', $file->getFilename())) {
				//cs_version.abstract.class.php becomes "cs_versionAbstract"
				$className = preg_replace('~.abstract\.php~', '', $file->getFilename()) . "Abstract";
//crazedsanity\cs_global::debug_print("\t". __METHOD__ .": (". $file->getFilename() .") changed to '". $className ."'",1);
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif((bool)preg_match('~\.interface\.php~', $file->getFilename())) {
				// Stores "iTemplate.interface.php"
				$className = preg_replace('~\.interface\.php~i', '', $file->getFilename());
//crazedsanity\cs_global::debug_print("\t". __METHOD__ .": (". $file->getFilename() .") changed to '". $className ."'",1);
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif (substr($file->getFilename(), -10) === '.class.php') {
				$className = preg_replace('~.class.php~', '', $file->getFilename());#substr($file->getFilename(), 0, -10);
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif (substr($file->getFilename(), -4) === '.php') {
				// save the class name / path of a .php file found
				$className = substr($file->getFilename(), 0, -4);
				AutoLoader::registerClass($className, $file->getPathname());
			}
		}
	}
	 
	public static function registerClass($className, $fileName) {
		AutoLoader::$classNames[$className] = $fileName;
	}
	 
	public static function loadClass($className) {
		// remove namespace from the className, if present.
		$bits = explode('\\', $className);
		if(count($bits) > 1) {
			$className = $bits[1];
		}
		if (isset(AutoLoader::$classNames[$className])) {
			require_once(AutoLoader::$classNames[$className]);<commit_msg>cleanup<commit_after><?php
//Original script (now modified) from: http://jes.st/2011/phpunit-bootstrap-and-autoloading-classes/
//TODO: make this non-static if possible.
/**
 * @codeCoverageIgnore
 */
class AutoLoader {
	 
	static private $classNames = array();
	 
	/**
	* Store the filename (sans extension) & full path of all ".php" files found
	*/
	public static function registerDirectory($dirName) {
		$di = new DirectoryIterator($dirName);
		foreach ($di as $file) {
//crazedsanity\cs_global::debug_print("\t". __METHOD__ .": processing $dirName (". $file->getFilename() .")... ",1);
			 
			if ($file->isDir() && !$file->isLink() && !$file->isDot()) {
				// recurse into directories other than a few special ones
				self::registerDirectory($file->getPathname());
			} 
			elseif (preg_match('~[Aa]bstract\.class~', $file->getFilename())) {
				//cs_version.abstract.class.php becomes "cs_versionAbstract"
				$className = preg_replace('~.abstract.class.php~i', '', $file->getFilename()) . "Abstract";
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif (preg_match('~\.abstract\.php~i', $file->getFilename())) {
				//cs_version.abstract.class.php becomes "cs_versionAbstract"
				$className = preg_replace('~.abstract\.php~', '', $file->getFilename()) . "Abstract";
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif((bool)preg_match('~\.interface\.php~', $file->getFilename())) {
				// Stores "iTemplate.interface.php"
				$className = preg_replace('~\.interface\.php~i', '', $file->getFilename());
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif (substr($file->getFilename(), -10) === '.class.php') {
				$className = preg_replace('~.class.php~', '', $file->getFilename());#substr($file->getFilename(), 0, -10);
				AutoLoader::registerClass($className, $file->getPathname());
			}
			elseif (substr($file->getFilename(), -4) === '.php') {
				// save the class name / path of a .php file found
				$className = substr($file->getFilename(), 0, -4);
				AutoLoader::registerClass($className, $file->getPathname());
			}
		}
	}
	 
	public static function registerClass($className, $fileName) {
		AutoLoader::$classNames[$className] = $fileName;
	}
	 
	public static function loadClass($className) {
		// remove namespace from the className, if present.
		$bits = explode('\\', $className);
		if(count($bits) > 1) {
			$className = $bits[1];
		}
		if (isset(AutoLoader::$classNames[$className])) {
			require_once(AutoLoader::$classNames[$className]);
{'fraction_non_alphanumeric': 0.20401826484018265, 'fraction_numerical': 0.006027397260273973, 'mean_word_length': 4.384464110127827, 'pattern_counts': {'":': 5, '<': 5, '<?xml version=': 0, '>': 50, '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': '5406853', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1711, 'n_words': 330}