public static function path($class, array $options = []) {
		$defaults = ['dirs' => false];
		$options += $defaults;
		$class = ltrim($class, '\\');

		if (isset(static::$_cachedPaths[$class]) && !$options['dirs']) {
			return static::$_cachedPaths[$class];
		}
		if (isset(static::$_map[$class]) && !$options['dirs']) {
			return static::$_map[$class];
		}
		foreach (static::$_configurations as $name => $config) {
			$params = $options + $config;
			$suffix = $params['suffix'];

			if ($params['prefix'] && strpos($class, $params['prefix']) !== 0) {
				continue;
			}
			if ($transform = $params['transform']) {
				if ($file = static::_transformPath($transform, $class, $params)) {
					return $file;
				}
				continue;
			}
			$path = str_replace("\\", '/', substr($class, strlen($params['prefix'])));
			$fullPath = "{$params['path']}/{$path}";

			if (!$options['dirs']) {
				return static::$_cachedPaths[$class] = static::realPath($fullPath . $suffix);
			}
			$list = glob(dirname($fullPath) . '/*');
			$list = array_map(function($i) { return str_replace('\\', '/', $i); }, $list);

			if (in_array($fullPath . $suffix, $list)) {
				return static::$_cachedPaths[$class] = static::realPath($fullPath . $suffix);
			}
			return is_dir($fullPath) ? static::realPath($fullPath) : null;
		}
	}