You are here

private function UriSigner::buildUrl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/UriSigner.php \Symfony\Component\HttpKernel\UriSigner::buildUrl()
2 calls to UriSigner::buildUrl()
UriSigner::check in vendor/symfony/http-kernel/UriSigner.php
Checks that a URI contains the correct hash.
UriSigner::sign in vendor/symfony/http-kernel/UriSigner.php
Signs a URI.

File

vendor/symfony/http-kernel/UriSigner.php, line 92

Class

UriSigner
Signs URIs.

Namespace

Symfony\Component\HttpKernel

Code

private function buildUrl(array $url, array $params = array()) {
  ksort($params);
  $url['query'] = http_build_query($params, '', '&');
  $scheme = isset($url['scheme']) ? $url['scheme'] . '://' : '';
  $host = isset($url['host']) ? $url['host'] : '';
  $port = isset($url['port']) ? ':' . $url['port'] : '';
  $user = isset($url['user']) ? $url['user'] : '';
  $pass = isset($url['pass']) ? ':' . $url['pass'] : '';
  $pass = $user || $pass ? "{$pass}@" : '';
  $path = isset($url['path']) ? $url['path'] : '';
  $query = isset($url['query']) && $url['query'] ? '?' . $url['query'] : '';
  $fragment = isset($url['fragment']) ? '#' . $url['fragment'] : '';
  return $scheme . $user . $pass . $host . $port . $path . $query . $fragment;
}