2017 © Pedro Peláez
 

library uri

RFC 3986 PHP URI extension

image

scholte/uri

RFC 3986 PHP URI extension

  • Sunday, July 9, 2017
  • by scholte
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

README

This object follows the PSR-7 HTTP message described at http://www.php-fig.org/psr/psr-7/ and RFC 3986. Every URI has a specific construction as shown below:, (*1)

tel:+31-123-456-789
urn:oasis:names:specification:docbook:dtd:xml:4.1.2
ftp://ftp.is.co.za/rfc/rfc1808.txt
mailto:John.Doe@example.com
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]
  1. Protocol: scheme
  2. Authentication: user:password
  3. Domain: www.host.com
  4. Port: 80
  5. Path: /path
  6. Query: ?parameter=value
  7. Fragment: #fragment

Installation

This package can be installed using composer:, (*2)

$ composer require scholte/uri

How to use

The URI object can be used for all RFC 3986 URI's. It is possible to change or extract specific parts of the URI without having to search and replace those parts., (*3)

<?php
use Scholte\Uri;

$uri = new Uri('scheme://user:password@www.host.com:80/path?parameter=value#fragment');
echo $uri->setScheme('https')->getUri(URI_STRIP_FRAGMENT);
// Output: https://user:password@www.host.com/path?parameter=value

$uri = new Uri('http://www.host.com/path');
echo $uri->getUri(URI_STRIP_SCHEME|URI_STRIP_HOST);
// Output: /path

About

Dependencies

  • Works with PHP 7.1 or higher
  • psr/http-message ^1.0

Author

Christiaan Scholte - cscholte_83@hotmail.com, (*4)

The Versions

09/07 2017

dev-master

9999999-dev

RFC 3986 PHP URI extension

  Sources   Download

The Requires

 

The Development Requires

by Christiaan Scholte

09/07 2017

dev-develop

dev-develop

RFC 3986 PHP URI extension

  Sources   Download

The Requires

 

The Development Requires

by Christiaan Scholte

09/07 2017

1.0.0

1.0.0.0

RFC 3986 PHP URI extension

  Sources   Download

The Requires

 

The Development Requires

by Christiaan Scholte