src/Support/Path.php
/**
	 * Joins two or more paths together and resolves them.
	 *
	 * @param string $path,...
	 * @return string
	 */
Joins two or more paths together and resolves them.
@param string $path,
@return string
Joins two or more paths together and resolves them . @param string $path @return string
public static function resolve() {
		$paths = func_get_args();
		$path = array_shift($paths);
		foreach ($paths as $segment) {
			if (!preg_match('/^([\/\\\]|[A-Z]:\\\)/', $segment)) {
				if ($segment == '.') continue;
				if (Str::startsWith($segment, './')) $segment = substr($segment, 2);
				$path = rtrim($path, '/\\');
				$path .= DIRECTORY_SEPARATOR . $segment;
			}
			else {
				$path = $segment;
			}
		}
		$path = str_replace(array('/', '\\'), array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR), $path);
		return static::makeProperPath($path);
	}
public static function resolve ( ) { $ paths = func_get_args ( ) ; $ path = array_shift ( $ paths ) ; foreach ( $ paths as $ segment ) { if ( ! preg_match ( '/^([\/\\\]|[A-Z]:\\\)/' , $ segment ) ) { if ( $ segment == '.' ) continue ; if ( Str :: startsWith ( $ segment , './' ) ) $ segment = substr ( $ segment , 2 ) ; $ path = rtrim ( $ path , '/\\' ) ; $ path .= DIRECTORY_SEPARATOR . $ segment ; } else { $ path = $ segment ; } } $ path = str_replace ( array ( '/' , '\\' ) , array ( DIRECTORY_SEPARATOR , DIRECTORY_SEPARATOR ) , $ path ) ; return static :: makeProperPath ( $ path ) ; }
Joins two or more paths together and resolves them.
Joins two or more paths together and resolves them .