This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Chat/URLResolver.php

37 lines
847 B
PHP
Raw Normal View History

2016-08-10 16:10:57 +00:00
<?php
/**
* Holds the url resolver.
* @package Sakura
*/
namespace Sakura\Chat;
/**
* Resolves URL data.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class URLResolver
{
/**
* Resolves a url.
* @param string $protocol
* @param string $slashes
* @param string $authority
* @param string $host
* @param string $port
* @param string $path
* @param string $query
* @param string $hash
* @return LinkInfo
*/
public static function resolve($protocol, $slashes, $authority, $host, $port, $path, $query, $hash)
{
$url = "{$protocol}:{$slashes}{$authority}{$host}{$port}{$path}{$query}{$hash}";
$info = new LinkInfo;
$info->URL = $info->OriginalURL = $url;
$info->Type = LinkInfo::TYPES['PLAIN'];
return $info;
}
}