PHP 클래스 GuzzleHttp\Psr7\UriResolver

저자: Tobias Schultze
파일 보기 프로젝트 열기: nystudio107/instantanalytics 1 사용 예제들

공개 메소드들

메소드 설명
relativize ( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $target ) : Psr\Http\Message\UriInterface Returns the target URI as a relative reference from the base URI.
removeDotSegments ( string $path ) : string Removes dot segments from a path and returns the new path.
resolve ( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $rel ) : Psr\Http\Message\UriInterface Converts the relative URI into a new URI that is resolved against the base URI.

비공개 메소드들

메소드 설명
__construct ( )
getRelativePath ( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $target )

메소드 상세

relativize() 공개 정적인 메소드

This method is the counterpart to resolve(): (string) $target === (string) UriResolver::resolve($base, UriResolver::relativize($base, $target)) One use-case is to use the current request URI as base URI and then generate relative links in your documents to reduce the document size or offer self-contained downloadable document archives. $base = new Uri('http://example.com/a/b/'); echo UriResolver::relativize($base, new Uri('http://example.com/a/b/c')); // prints 'c'. echo UriResolver::relativize($base, new Uri('http://example.com/a/x/y')); // prints '../x/y'. echo UriResolver::relativize($base, new Uri('http://example.com/a/b/?q')); // prints '?q'. echo UriResolver::relativize($base, new Uri('http://example.org/a/b/')); // prints '//example.org/a/b/'. This method also accepts a target that is already relative and will try to relativize it further. Only a relative-path reference will be returned as-is. echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well
public static relativize ( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $target ) : Psr\Http\Message\UriInterface
$base Psr\Http\Message\UriInterface Base URI
$target Psr\Http\Message\UriInterface Target URI
리턴 Psr\Http\Message\UriInterface The relative URI reference

removeDotSegments() 공개 정적인 메소드

Removes dot segments from a path and returns the new path.
public static removeDotSegments ( string $path ) : string
$path string
리턴 string

resolve() 공개 정적인 메소드

Converts the relative URI into a new URI that is resolved against the base URI.
public static resolve ( Psr\Http\Message\UriInterface $base, Psr\Http\Message\UriInterface $rel ) : Psr\Http\Message\UriInterface
$base Psr\Http\Message\UriInterface Base URI
$rel Psr\Http\Message\UriInterface Relative URI
리턴 Psr\Http\Message\UriInterface