Changelog
All Notable changes to Url version 3 will be documented in this file
version 3.3.5
Fixed
- Bug fix path get relative pull request #81
 
version 3.3.4
Fixed
- Bug fix Query parsing pull request #79
 
version 3.3.3
Fixed
- Update 
True\Punycoderequirement to 2.0.0 to allow PHP7 support 
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
isEmptymethod toLeague\Url\Interfaces\Urlto tell whether a URL is empty or notisSupportedstatic method toLeague\Url\Schemeto tell whether a specified scheme is supported by the library- Add support for the 
gopherscheme 
Fixed
- Improve Punycode decoding/encoding issue #73
 
Remove
- Support for the pseuod 
gitandsvnprotocol 
version 4.0.0-beta2
Fixed
- remove useless optional argument from 
Path::getUriComponent 
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 4.0.0-beta1
Added
- Package structure is changed to better reflect the importance of each component.
 - Package is now more RFC3986 compliant
 League\Url\UserInfoclass added to better manipulate URL user info partLeague\Url\Output\Formatterclass added to ease URL and URL components formatting.- All Url related classes are now immutable value objects.
 League\Url\UrlimplementsPsr\Http\Message\UriInterface- Methods to ease complete or partial component modifications are added to  
League\Url\Url - Url components and Url Parts can now be compared to each other using the 
sameValueAsmethod League\Url\Host,League\Url\Pathcomponent public API are simplified.League\Url\Hostnow supports IP style hosts and FQDNLeague\Url\Host::__toStringmethod now always return the ascii version of the hostname- More methods are added to the 
League\Url\Pathobject to extract generic path info as well as modifying the path according to RFC3986 (i.e.: removing dot segments) League\Url\Querypublic API is simplified to remove ambiguityLeague\Url\Queryno longer depends on phpparse_strandhttp_build_queryLeague\Url\SchemeandLeague\Url\Portare rewritten completely
Fixed
- Handling of legacy hostname suffixed with a “.” when using 
Url::createFromServer 
Remove
League\Url\UserandLeague\Url\Passare replaced by the more genericLeague\Url\Component- Support for 
PHP 5.3 League\Url\UrlImmutableclass is replaced byLeague\Url\Urlwhich is now immutable- Most of the public API is removed :
    
- to comply to 
RFC3986; - to enable immutable value object;
 - to implement 
PSR7UriInterface; 
 - to comply to 
 
Please refers to the documentation or the library CHANGELOG for more details and a complete list of changes
version 3.3.2
Fixed
- Bug fix URL parsing issue #65
 
version 3.3.1
Fixed
version 3.3.0
Added
- adding the 
toArraymethod toLeague\Url\AbstractUrlto output the URL like PHP nativeparse_urlissue #56 
Fixed
League\Url\Components\Querybug fix remove parameter only if the value equalsnullissue #58
More informations can be found on the documentation website
version 3.2.1
League\Url\AbstractUrl::createFromServerbug fix handling of$_SERVER['HTTP_HOST']
version 3.2.0
- adding a CHANGELOG
 - adding the following methods to 
League\Url\AbstractUrlgetUserInfogetAuthoritysameValueAs
 League\Url\Components\Fragment::__toStringencoding symbols according to RFC3986
version 3.1.1
- Bug fix pars_str does not preserve key params #32
 
version 3.1.0
Adding IDN support #17
- The library now requires the 
mbstringextension to work. 
The following methods were added:
League\Url\Components\Host::toAsciiLeague\Url\Components\Host::toUnicodeas an alias ofLeague\Url\Components\Host::__toString
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
- Support for FTP Urls
 - Adding a UrlImmutable value object
 - Library rewrote from scratch
 
New
League\Url\UrlInterfaceintroducedLeague\Url\Urlnow implementsLeague\Url\UrlInterfaceLeague\Url\UrlImmutableimplementsLeague\Url\UrlInterfaceLeague\Url\Components\ComponentInterfaceintroduced to normalized All URLs components objectsLeague\Url\Components\Userto deal with URL User component objectLeague\Url\Components\Pathto deal with URL Path component object
Backward incompatible
- URL component setter and getter names normalized according to PHP Url component as used by 
parse_url - Each getter returns an object that implements at least the 
League\Url\Components\ComponentInterface - To instantiate a 
League\Url\Urlobject orLeague\Url\UrlImmutableobject use the static methodscreateFromUrland/orcreateFromServer 
The following class are removed:
League\Url\FactoryLeague\Url\Components\Auth
More informations can be found on the documentation website
version 3.0.0-rc.2
Changelog
League\Url\FactorybecomesLeague\Url\AbstractUrlwhich implementsLeague\Url\UrlInterfaceLeague\Url\UrlandLeague\Url\UrlImmutableextendsLeague\Url\AbstractUrlLeague\Url\AbstractUrl::createFromStringrenamedLeague\Url\AbstractUrl::createFromUrl- removed 
League\Url\EncodingInterfacefromLeague\Url\AbstractUrl - moved 
League\Url\EncodingInterfacetoLeague\Url\Components\EncodingInterface - adding optional 
$enc_typeargument toLeague\Url\Url::setQueryandLeague\Url\UrlImmutable::setQuery - adding 
exchangemethods to all Components classes - 
    
bug fix
League\Url\Components\AbstractSegment::setmethod - documentation updated to reflect the changes
 
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.
League\Url\Url::modifyQueryLeague\Url\Url::prependPathLeague\Url\Url::appendPathLeague\Url\Url::removePathLeague\Url\Url::prependHostLeague\Url\Url::appendHostLeague\Url\Url::removeHost
One Library Two Url value objects
League\Url\Urlis a mutable Value Object. (similar to its V2 version)League\Url\UrlImmutableis an immutable Value Object.
//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
- improved URL query encoding and decoding
 - renamed and improved 
ComponentArrayIterface::fetchKeystoComponentArrayIterface::keys 
Version 3.0.0-beta2
- adding 
League\Url\Url::sameValueAsmethod to compare twoLeague\Url\Urlobjects - improved URL path encoding and decoding
 - improved URL host validation
 
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
- Moving from PSR-0 to PSR-4
 - adding support for PHP 5.6
 
version 2.1.1
Remove file from Components directory
version 2.1.0
- 
    
Bakame\Url\Components\HostandBakame\Url\Components\Pathnow extends an Abstract Class calledBakame\Url\Components\AbstractSegment - 
    
Bakame\Url\Components\AbstractSegment::prependandBakame\Url\Components\AbstractSegment::appendmethods have been rewrote - 
    
Bakame\Url\Urlis now clonable - 
    
Bakame\Url\Components\Querynow has aremovemethod 
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
- move the Components Classes to their own directory
 - modify Components classes 
__toString()method to make the component class more decoupled from each other - modify 
\Bakame\Url\Urlclass to take advantage of the component class more easily - now 
\Bakame\Url\Urlclass is clonable \Bakame\Url\Components\Querynow implementsArrayAcces,IteratorAggregae,Countableinterfaces- you can merge different  
\Bakame\Url\Components\Querywith thesetmethod \Bakame\Url\Components\Pathand\Bakame\Url\Components\Hostextends the\Bakame\Url\Components\Segmentclass
version 1.0.1
Bug Fixes  Bakame\Url\Factory  Methods:
createFromStringwotks will malformed parser url in PHP 5.3createFromServeroptimisation
version 1.0.0
Initial release for Bakame/Url