thephpleague/url — pull request #39 by christickner (2014-09-04 20:02:56+00:00)
Title: Adds support for "localhost" hostname

Modifies the package implementation of Host to allow for "special" hostnames.

As a developer, I do still use "localhost" from time to time, and occasionally use it in my code for testing purposes. Today, running some testing, the URL "http://localhost:8080/path" got an exception from this package.

So, the first "special" hostname (maybe it'll be the only one ever) I recommend is "localhost".

Initially, I tried to make the package work nicely with one part hostnames in general, but that was not working out because we already had the following test, and I didn't want to break BC:

```php
/**
* @expectedException RuntimeException
*/
public function testCreateFromUrlBadName2()
{
Url::createFromUrl('sdfsdfqsdfsdf');
}
```

The URL specs don't say anything about this being illegal. Well, they do, in the sense that you need a scheme, but if "google.com" is legal to use with this method, then "localhost" should be too.