<commit_before><?php
/**
 *  php -d phar.readonly=0 **.php
 */
$filename = substr(basename(__FILE__),0,strpos(basename(__FILE__),'.'));

if(isset($argv[1])){
	$output = $argv[1];
}else{
	$output = __DIR__.'/'.$filename.'.phar';
}
$basedir = __DIR__.'/src/';
$basedirlen = strlen($basedir);

if(is_file($output)){
	unlink($output);
}
try{
	$phar = new Phar($output,0,$filename.'.phar');
	
	foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
			$basedir,
			FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS
			),RecursiveIteratorIterator::SELF_FIRST
	) as $f){
		$phar[substr($f,$basedirlen)] = file_get_contents($f);
	}
	$phar['autoload.php'] = file_get_contents(__DIR__.'/autoload.php');
	
	$stab = <<< 'STAB'
<?php
	spl_autoload_register(function($c){
		$c = str_replace('\\','/',$c);
		if(substr($c,0,4) == 'ebi/' && is_file($f='phar://'.__FILE__.'/'.$c.'.php')){
			require_once($f);<commit_msg>ディレクトリがaddされてなかった<commit_after><?php
/**
 *  php -d phar.readonly=0 **.php
 */
$filename = substr(basename(__FILE__),0,strpos(basename(__FILE__),'.'));

if(isset($argv[1])){
	$output = $argv[1];
}else{
	$output = __DIR__.'/'.$filename.'.phar';
}
$basedir = __DIR__.'/src/';
$basedirlen = strlen($basedir);

if(is_file($output)){
	unlink($output);
}
try{
	$mkdir = array();
	$files = array();
	$phar = new Phar($output,0,$filename.'.phar');
	
	foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
			$basedir,
			FilesystemIterator::SKIP_DOTS|FilesystemIterator::UNIX_PATHS
			),RecursiveIteratorIterator::SELF_FIRST
	) as $f){
		if($f->isFile()){
			$path = substr($f,$basedirlen);
			$dir = dirname($path);
	
			if($dir != '.'){
				$d = explode('/',$dir);
				while(!empty($d)){
					$dp = implode('/',$d);
	
					if(isset($mkdir[$dp])){
						break;
					}
					$mkdir[$dp] = $dp;
					array_shift($d);
				}
			}
			$files[$path] = $f->getPathname();
		}
	}
	ksort($mkdir);
	
	foreach($mkdir as $d){
		$phar->addEmptyDir($d);
	}
	foreach($files as $k => $v){
		$phar->addFile($v,$k);
	}
	$phar->addFile(__DIR__.'/autoload.php','autoload.php');
	
	$stab = <<< 'STAB'
<?php
	spl_autoload_register(function($c){
		$c = str_replace('\\','/',$c);
		if(substr($c,0,4) == 'ebi/' && is_file($f='phar://'.__FILE__.'/'.$c.'.php')){
			require_once($f);
{'fraction_non_alphanumeric': 0.24520069808027922, 'fraction_numerical': 0.006108202443280977, 'mean_word_length': 4.790404040404041, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '2426487', 'n_tokens_mistral': 1043, 'n_tokens_neox': 954, 'n_words': 118}