Factory method to create a new URL from a URL string
string $url Full URL used to create a Url object:
public static function factory($url) {
$parts = ParserRegistry::getInstance()
->getParser('url')
->parseUrl($url);
// Convert the query string into a QueryString object
if ($parts['query']) {
$parts['query'] = QueryString::fromString($parts['query']);
}
return new self($parts['scheme'], $parts['host'], $parts['user'], $parts['pass'], $parts['port'], $parts['path'], $parts['query'], $parts['fragment']);
}