<commit_before><?php

/**
 * simple autoloader
 * @param  string $namespace
 * @return bool
 */
function afterAutoload($namespace) {
	# change directory if not usual installed
	$directoryList = array(
		'public/src/',
		'private/src/'
	);

	# binary folders on command line
	if (PHP_SAPI === 'cli') {
		$directoryList[] = 'public/bin/';
		$directoryList[] = 'private/bin/';
		$prefix = '';
	}
	else {
		$prefix = '../';
	}
	
	$suffix = '.class.php';
	$itemList = explode('\\', $namespace);
	
	foreach ($directoryList as $directory) {
		$path = $prefix.$directory.implode('/', $itemList).$suffix;
		if (file_exists($path)) {
			include_once $path;
			return true;
		}
	}
	return false;
}

# register spl autoloader
spl_autoload_register('afterAutoload', true);<commit_msg>prefix global as ROOT_DIR constant<commit_after><?php

/**
 * simple autoloader
 * @param  string $namespace
 * @return bool
 */
function afterAutoload($namespace) {
	# change directory if not usual installed
	$directoryList = array(
		'public/src/',
		'private/src/'
	);

	# binary folders on command line
	if (PHP_SAPI === 'cli') {
		$directoryList[] = 'public/bin/';
		$directoryList[] = 'private/bin/';
	}
	
	$suffix = '.class.php';
	$itemList = explode('\\', $namespace);
	
	foreach ($directoryList as $directory) {
		$path = constant('ROOT_DIR').$directory.implode('/', $itemList).$suffix;
		if (file_exists($path)) {
			include_once $path;
			return true;
		}
	}
	return false;
}

# set root dir
if (PHP_SAPI === 'cli') {
	define('ROOT_DIR', '');
}
else {
	define('ROOT_DIR', '../');
}

# register spl autoloader
spl_autoload_register('afterAutoload', true);
{'fraction_non_alphanumeric': 0.1790953545232274, 'fraction_numerical': 0.0, 'mean_word_length': 3.9908536585365852, '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': '2746163', 'n_tokens_mistral': 609, 'n_tokens_neox': 568, 'n_words': 129}