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\Punycode
requirement 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
isEmpty
method toLeague\Url\Interfaces\Url
to tell whether a URL is empty or notisSupported
static method toLeague\Url\Scheme
to tell whether a specified scheme is supported by the library- Add support for the
gopher
scheme
Fixed
- Improve Punycode decoding/encoding issue #73
Remove
- Support for the pseuod
git
andsvn
protocol
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\UserInfo
class added to better manipulate URL user info partLeague\Url\Output\Formatter
class added to ease URL and URL components formatting.- All Url related classes are now immutable value objects.
League\Url\Url
implementsPsr\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
sameValueAs
method League\Url\Host
,League\Url\Path
component public API are simplified.League\Url\Host
now supports IP style hosts and FQDNLeague\Url\Host::__toString
method now always return the ascii version of the hostname- More methods are added to the
League\Url\Path
object to extract generic path info as well as modifying the path according to RFC3986 (i.e.: removing dot segments) League\Url\Query
public API is simplified to remove ambiguityLeague\Url\Query
no longer depends on phpparse_str
andhttp_build_query
League\Url\Scheme
andLeague\Url\Port
are rewritten completely
Fixed
- Handling of legacy hostname suffixed with a “.” when using
Url::createFromServer
Remove
League\Url\User
andLeague\Url\Pass
are replaced by the more genericLeague\Url\Component
- Support for
PHP 5.3
League\Url\UrlImmutable
class is replaced byLeague\Url\Url
which is now immutable- Most of the public API is removed :
- to comply to
RFC3986
; - to enable immutable value object;
- to implement
PSR7
UriInterface;
- 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
toArray
method toLeague\Url\AbstractUrl
to output the URL like PHP nativeparse_url
issue #56
Fixed
League\Url\Components\Query
bug fix remove parameter only if the value equalsnull
issue #58
More informations can be found on the documentation website
version 3.2.1
League\Url\AbstractUrl::createFromServer
bug fix handling of$_SERVER['HTTP_HOST']
version 3.2.0
- adding a CHANGELOG
- adding the following methods to
League\Url\AbstractUrl
getUserInfo
getAuthority
sameValueAs
League\Url\Components\Fragment::__toString
encoding 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
mbstring
extension to work.
The following methods were added:
League\Url\Components\Host::toAscii
League\Url\Components\Host::toUnicode
as 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\UrlInterface
introducedLeague\Url\Url
now implementsLeague\Url\UrlInterface
League\Url\UrlImmutable
implementsLeague\Url\UrlInterface
League\Url\Components\ComponentInterface
introduced to normalized All URLs components objectsLeague\Url\Components\User
to deal with URL User component objectLeague\Url\Components\Path
to 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\Url
object orLeague\Url\UrlImmutable
object use the static methodscreateFromUrl
and/orcreateFromServer
The following class are removed:
League\Url\Factory
League\Url\Components\Auth
More informations can be found on the documentation website
version 3.0.0-rc.2
Changelog
League\Url\Factory
becomesLeague\Url\AbstractUrl
which implementsLeague\Url\UrlInterface
League\Url\Url
andLeague\Url\UrlImmutable
extendsLeague\Url\AbstractUrl
League\Url\AbstractUrl::createFromString
renamedLeague\Url\AbstractUrl::createFromUrl
- removed
League\Url\EncodingInterface
fromLeague\Url\AbstractUrl
- moved
League\Url\EncodingInterface
toLeague\Url\Components\EncodingInterface
- adding optional
$enc_type
argument toLeague\Url\Url::setQuery
andLeague\Url\UrlImmutable::setQuery
- adding
exchange
methods to all Components classes -
bug fix
League\Url\Components\AbstractSegment::set
method - 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::modifyQuery
League\Url\Url::prependPath
League\Url\Url::appendPath
League\Url\Url::removePath
League\Url\Url::prependHost
League\Url\Url::appendHost
League\Url\Url::removeHost
One Library Two Url value objects
League\Url\Url
is a mutable Value Object. (similar to its V2 version)League\Url\UrlImmutable
is 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::fetchKeys
toComponentArrayIterface::keys
Version 3.0.0-beta2
- adding
League\Url\Url::sameValueAs
method to compare twoLeague\Url\Url
objects - 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\Host
andBakame\Url\Components\Path
now extends an Abstract Class calledBakame\Url\Components\AbstractSegment
-
Bakame\Url\Components\AbstractSegment::prepend
andBakame\Url\Components\AbstractSegment::append
methods have been rewrote -
Bakame\Url\Url
is now clonable -
Bakame\Url\Components\Query
now has aremove
method
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\Url
class to take advantage of the component class more easily - now
\Bakame\Url\Url
class is clonable \Bakame\Url\Components\Query
now implementsArrayAcces
,IteratorAggregae
,Countable
interfaces- you can merge different
\Bakame\Url\Components\Query
with theset
method \Bakame\Url\Components\Path
and\Bakame\Url\Components\Host
extends the\Bakame\Url\Components\Segment
class
version 1.0.1
Bug Fixes Bakame\Url\Factory
Methods:
createFromString
wotks will malformed parser url in PHP 5.3createFromServer
optimisation
version 1.0.0
Initial release for Bakame/Url