You are here

public function Uri::__construct in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/Uri.php \Zend\Diactoros\Uri::__construct()
  2. 8 vendor/zendframework/zend-feed/src/Uri.php \Zend\Feed\Uri::__construct()
  3. 8 vendor/guzzlehttp/psr7/src/Uri.php \GuzzleHttp\Psr7\Uri::__construct()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Uri.php \Zend\Feed\Uri::__construct()

Parameters

string $uri:

File

vendor/zendframework/zend-feed/src/Uri.php, line 71

Class

Uri

Namespace

Zend\Feed

Code

public function __construct($uri) {
  $parsed = parse_url($uri);
  if (false === $parsed) {
    $this->valid = false;
    return;
  }
  $this->scheme = isset($parsed['scheme']) ? $parsed['scheme'] : null;
  $this->host = isset($parsed['host']) ? $parsed['host'] : null;
  $this->port = isset($parsed['port']) ? $parsed['port'] : null;
  $this->user = isset($parsed['user']) ? $parsed['user'] : null;
  $this->pass = isset($parsed['pass']) ? $parsed['pass'] : null;
  $this->path = isset($parsed['path']) ? $parsed['path'] : null;
  $this->query = isset($parsed['query']) ? $parsed['query'] : null;
  $this->fragment = isset($parsed['fragment']) ? $parsed['fragment'] : null;
}