<commit_before><?php
namespace zeus\loader;

class Autoloader
{
	/**
	 * Array of available namespaces prefixes.
	 * @var array
	 */
	private $prefixes = array();
	/**
	 * Class map array.
	 * @var array
	 */
	private $classmap = array();
	
	/**
	 * Class file path array
	 * @var array
	 */
	private $_includeDir = array();
	
	public function __construct()
	{
		spl_autoload_register($this, true, true);
	}
	
	public function registerNamespaces($namespace, $directory)
	{
		$this->prefixes[$namespace] = realpath($directory);
		
		return $this;
	}
	
	public function registerDirs(array $dirs)
	{
		$this->_includeDir = array_unique(array_merge($this->_includeDir,$dirs));
		
		return $this;
	}
	
	public function registerClassMap($class,$map = '')
	{
		if( is_array($class))<commit_msg>change: Autoload自动加载。<commit_after><?php
namespace zeus\loader;

class Autoloader
{
	/**
	 * Array of available namespaces prefixes.
	 * @var array
	 */
	private $prefixes = array();
	/**
	 * Class map array.
	 * @var array
	 */
	private $classmap = array();
	
	/**
	 * Class file path array
	 * @var array
	 */
	private $_includeDir = array();
	
	public function __construct()
	{
		spl_autoload_register($this, true, true);
	}
	
	public function registerNamespaces($namespace, $directory)
	{
		$this->prefixes[$namespace] = realpath($directory);
		
		return $this;
	}
	
	public function registerDirs($dirs)
	{
		if( is_array($dirs) )
		{
			$this->_includeDir = array_unique(array_merge($this->_includeDir,$dirs));
		}
		else 
		{
			$this->_includeDir = array_unique(array_push($this->_includeDir, $dirs));
		}
		
		return $this;
	}
	
	public function registerClassMap($class,$map = '')
	{
		if( is_array($class))
{'fraction_non_alphanumeric': 0.14864864864864866, 'fraction_numerical': 0.0, 'mean_word_length': 3.810734463276836, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '2237327', 'n_tokens_mistral': 630, 'n_tokens_neox': 560, 'n_words': 123}