Changeset View
Changeset View
Standalone View
Standalone View
src/parser/PhutilURI.php
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | public function __construct($uri, $params = array()) { | ||||
$this->protocol = idx($parts, 'scheme', ''); | $this->protocol = idx($parts, 'scheme', ''); | ||||
$this->user = rawurldecode(idx($parts, 'user', '')); | $this->user = rawurldecode(idx($parts, 'user', '')); | ||||
$this->pass = rawurldecode(idx($parts, 'pass', '')); | $this->pass = rawurldecode(idx($parts, 'pass', '')); | ||||
$this->domain = idx($parts, 'host', ''); | $this->domain = idx($parts, 'host', ''); | ||||
$this->port = (string)idx($parts, 'port', ''); | $this->port = (string)idx($parts, 'port', ''); | ||||
$this->path = idx($parts, 'path', ''); | $this->path = idx($parts, 'path', ''); | ||||
$query = idx($parts, 'query'); | $query = idx($parts, 'query'); | ||||
if ($query) { | if ($query) { | ||||
$pairs = id(new PhutilQueryStringParser()) | $pairs = (new PhutilQueryStringParser()) | ||||
->parseQueryStringToPairList($query); | ->parseQueryStringToPairList($query); | ||||
foreach ($pairs as $pair) { | foreach ($pairs as $pair) { | ||||
list($key, $value) = $pair; | list($key, $value) = $pair; | ||||
$this->appendQueryParam($key, $value); | $this->appendQueryParam($key, $value); | ||||
} | } | ||||
} | } | ||||
$this->fragment = idx($parts, 'fragment', ''); | $this->fragment = idx($parts, 'fragment', ''); | ||||
▲ Show 20 Lines • Show All 427 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0