2017 © Pedro Peláez
 

library uri

URI, URL and URN value objects

image

psx/uri

URI, URL and URN value objects

  • Tuesday, February 13, 2018
  • by k42b3
  • Repository
  • 1 Watchers
  • 2 Stars
  • 24,189 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 14 % Grown

The README.md

Uri

About

Library which contains value objects to represent URI, URL and URNs. The value objects are immutable so in case you change a value through a with* method you get a new instance of that object. There is also a uri resolver class to resolve a uri against a base uri., (*1)

Usage

<?php

$uri = Uri::parse('/bar?foo=bar');

$uri->getPath(); // /bar
$uri->getQuery(); // foo=bar
$uri->getParameters(); // ['foo' => 'bar']

$uri = $uri->withScheme('https');
$uri = $uri->withScheme('foo.com');

echo $uri->toString(); // https://foo.com/bar?foo=bar

// the url object validates whether a scheme and host is available thus it is a valid url
$url = Url::parse($uri->toString());

// a urn provides additional getter to get the urn specific components. A urn must start with urn:
$urn = Urn::parse('urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66');

$urn->getNid(); // uuid
$urn->getNss(); // 6e8bc430-9c3a-11d9-9669-0800200c9a66

The Versions

13/02 2018

dev-master

9999999-dev http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn

13/02 2018

v1.0.4

1.0.4.0 http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn

30/07 2017

v1.0.3

1.0.3.0 http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn

14/06 2017

v1.0.2

1.0.2.0 http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn

20/06 2016

v1.0.1

1.0.1.0 http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn

02/04 2016

v0.1.0

0.1.0.0 http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn

02/04 2016

v1.0.0

1.0.0.0 http://phpsx.org

URI, URL and URN value objects

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

url uri urn