The League of Extraordinary Packages

Our Packages:

Presented by The League of Extraordinary Packages

Getting Started

The API

The Components

Url is end of life. We strongly encourage you to use League\Uri instead.

Changelog

All Notable changes to Url version 3 will be documented in this file

version 3.3.5

Fixed

version 3.3.4

Fixed

version 3.3.3

Fixed

More informations can be found on the documentation website

This is the last release in the League\Url 3.x series

version 4.0.0-beta3

Added

Fixed

Remove

version 4.0.0-beta2

Fixed

Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes

version 4.0.0-beta1

Added

Fixed

Remove

Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes

version 3.3.2

Fixed

version 3.3.1

Fixed

version 3.3.0

Added

Fixed

More informations can be found on the documentation website

version 3.2.1

version 3.2.0

version 3.1.1

version 3.1.0

Adding IDN support #17

The following methods were added:

More informations can be found on the documentation website

version 3.0.1

Bug fix invalid URI parsing.

version 3.0.0

Changelog from version 2 to version 3

Summary

New

Backward incompatible

The following class are removed:

More informations can be found on the documentation website

version 3.0.0-rc.2

Changelog

version 3.0.0-rc.1

Remove duplicated methods

methods like League\Url\Url::prependPath that were only proxy to URL component object method have been removed.

One Library Two Url value objects

//From a League\Url\Url object 
$url = $url_factory->createFromString('https://www.example.com');
$url
	->setUser('john')
	->setPass('doe')
	->setPort(443)
	->setScheme('https');
echo $url; // https://john:doe@www.example.com:443/

$port = $url->getPort();
$port->set(80);
echo $port; // output 80;
echo $url->getPort(); // output 80;

//From a League\Url\UrlImmutable object 
$url = $url_factory->createFromString('http://www.example.com', Factory::URL_IMMUTABLE);
$new_url = $url
		->setUser('john')
		->setPass('doe')
		->setPort(443)
		->setScheme('https');
echo $url; //remains http://www.example.com/
echo $new_url; //output https://john:doe@www.example.com:443/

$port = $new_url->getPort(); //$port is a clone object of the URL port component.
$port->set(80);
echo $port; // output 80;
echo $new_url->getPort(); // remains 443;

Factory has been rewritten

The League\Url\Factory is now a full object with a constructor. and returns a value object depending on 2 new constants: * Factory::URL_MUTABLE * Factory::URL_IMMUTABLE

require 'vendor/autoload.php' //when using composer

use League\Url\Factory;

$url_factory = new Factory(PHP_QUERY_RFC1738);

//Method 1 : from a given string
$url = $url_factory->createFromString('http://www.example.com');
$url_immutable = $url_factory->createFromString('http://www.example.com', Factory::URL_IMMUTABLE);

$url_factory->setEncoding(PHP_QUERY_RFC3968);

//Method 2: from the current PHP page
//don't forget to provide the $_SERVER array
$url = $url_factory->createFromServer($_SERVER); 
$url_immutable = $url_factory->createFromServer($_SERVER, Factory::URL_IMMUTABLE);

Many components have been improved and bug fixed

Version 3.0.0-beta3

Version 3.0.0-beta2

Version 3.0.0-beta1

Immutable Value Object

League\Url\Url is now a Immutable Value Object. This means that any change made to the object will return a new object with the changed property and will leave the original object unchanged.

use League\Url\Factory as Url;
$original_url = Url::createFromString('http://www.example.com');
$modified_url = $original_url->setQuery(array('foo' => 'bar'));
echo $original_url; // output http://www.example.com/
echo $modified_url; // output http://www.example.com/?foo=bar

Prior to version 3, some url component properties where returned as string and other as object. Now all component property are returned: * as object that implement a common Interface which includes the __toString method; * as cloned from the internal property to avoid breaking the League\Url\Url Immutable state;

use League\Url\Factory as Url;
$original_url = Url::createFromString('http://www.example.com');
$host = $original_url->getHost();
$host->remove('www');
$host->prepend('test');
echo $original_url; // output http://www.example.com/
echo $host; // output test.example.com

Url parsing has been improved as well as League\Url\Url::__toString() methods.

version 2.1.2

version 2.1.1

Remove file from Components directory

version 2.1.0

version 2.0.2

Bakame\Url\Components\Segment now implements Countable and IteratorAggregate Interfaces

version 2.0.1

Bug fix in Bakame\Url\Components\Query

version 2.0.0

version 1.0.1

Bug Fixes Bakame\Url\Factory Methods:

version 1.0.0

Initial release for Bakame/Url