scheme = strtolower($value); return $clone; } public function getScheme() { return $this->scheme; } public function withUserInfo($user, $password = null) { $clone = clone $this; $clone->username = $user; $clone->password = $password; return $clone; } public function getUserInfo() { return $this->username . (!empty($this->password) ? ':' . rawurlencode($this->password) : '' ); } /** * @return mixed */ public function getUsername() { return $this->username; } /** * @return mixed */ public function getPassword() { return $this->password; } public function withHost($value) { $clone = clone $this; $clone->host = $value; return $clone; } public function getHost() { return $this->host; } /** * @param int|string|null $value * @return $this */ public function withPort($value) { $clone = clone $this; $clone->port = $value; return $clone; } public function getPort() { return $this->port; } public function withPath($value) { $clone = clone $this; $clone->path = $value; return $clone; } public function getPath() { return $this->path; } public function withQuery($query) { $clone = clone $this; $clone->setQuery($query); return $clone; } protected function setQuery($query) { parse_str($query, $this->query); return $this; } public function getQuery() { return http_build_query($this->query, "", "&", PHP_QUERY_RFC3986); } /** * @param string $key * @param string|array $value * @param bool $isEncoded * @return $this */ public function withQueryKeyValue($key, $value, $isEncoded = false) { $clone = clone $this; $clone->query[$key] = ($isEncoded ? rawurldecode($value) : $value); return $clone; } /** * Not from UriInterface * * @param $key * @return string */ public function getQueryPart($key) { return $this->getFromArray($this->query, $key); } private function getFromArray($array, $key, $default = null) { if (isset($array[$key])) { return $array[$key]; } return $default; } public function getFragment() { return $this->fragment; } public function withFragment($fragment) { $clone = clone $this; $clone->fragment = $fragment; return $clone; } public function getAuthority() { return $this->concatSuffix($this->getUserInfo(), "@") . $this->getHost() . $this->concatPrefix(':', $this->getPort()); } public function __toString() { return $this->concatSuffix($this->getScheme(), '://') . $this->getAuthority() . $this->getPath() . $this->concatPrefix('?', $this->getQuery()) . $this->concatPrefix('#', $this->getFragment()); } private function concatSuffix($str, $suffix) { if (!empty($str)) { $str = $str . $suffix; } return $str; } private function concatPrefix($prefix, $str) { if (!empty($str)) { $str = $prefix . $str; } return $str; } /** * @param string $uri */ public function __construct($uri = null) { if (empty($uri)) { return; } $pattern = "/^" . "(?:(?P\w+):\/\/)?" . "(?:(?P\S+?):(?P\S+)@)?" . "(?:(?P\S+)@)?" . "(?:(?P(?![A-Za-z]:)[\w\d\-]+(?:\.[\w\d\-]+)*))?" . "(?::(?P[\d]+))?" . "(?P([A-Za-z]:)?[^?#]+)?" . "(?:\?(?P[^#]+))?" . "(?:#(?P.*))?" . "$/"; preg_match($pattern, $uri, $parsed); $user = $this->getFromArray($parsed, 'user'); if (empty($user)) { $user = $this->getFromArray($parsed, 'user2'); } $this->scheme = $this->getFromArray($parsed, 'scheme'); $this->host = $this->getFromArray($parsed, 'host'); $this->port = $this->getFromArray($parsed, 'port'); $this->username = $user; $this->password = rawurldecode($this->getFromArray($parsed, 'pass')); $this->path = preg_replace('~^//~', '', $this->getFromArray($parsed, 'path', "")); $this->path = empty($this->path) ? null : $this->path; $this->setQuery($this->getFromArray($parsed, 'query', "")); $this->fragment = $this->getFromArray($parsed, 'fragment'); } public static function getInstanceFromString($uriString = null) { return new Uri($uriString); } public static function getInstanceFromUri(UriInterface $uri) { return self::getInstanceFromString((string)$uri); } } __halt_compiler();----SIGNATURE:----YUwp8eMu+gxOdRHG42GP48ru0inn1C2wCitf2pZWij040bLjeCVdJvbz6bTTkBusJ43gxDolNDUrzvr3N4rXc89krSYCVM95/iHeU0LhxCE9BcjF4VHNhnfv5khCVojEzkmT/MssyLdDB/9SmsIIWAB51TfV/4og3LqWXgLc238FHVW86rMwQ27EB7uwG9lbEp3pgo1dlS95GFzM6wgkS+/ZbMZmLZKEe4dgAzH/e9tTeZd2ts41DTaSgUsfu25y13l8c81GBR2Lnvs1EuBmnFFXMp23WhOAWwSyx4NS2vQ7LkxHQWG9kobfbiefY8Ginkx76jFMx0p6WPxgdjpWNX5HSGqbhido3mcj6vBLe03S1QFDyMb0nFUhImBxfAehxOvubDSDr+VNGKWbGUxw8q1EC0uey8SRMKUrtttBMxkM+RWLTQR3K9AZNzOFQaiOTnnjtrUXK7Z2mGMPNMPgfFxY7GU+NAC7FeHprpdpdlUO9Ok0qD1+uu1/mKEywH8cbv8wj4Tc7NlJyx5MB1kgPVMaxZS10BOvQy3ZZEQgK+TLbYwGSBVv7Y5dU0YudptotcfuEH7riZP3YWwFf43qx1zs0zz1LljqsCLPp2p4nAgpIjYYBLHn2DdRcQemUFFGs5rhMlAYprVvpULhnUvbQ1qdpq4ZR+ksOKTHz334TMc=----ATTACHMENT:----Njc0Mjk4NjQzMjcyNzYyMiA1NDE3NDM5NzU2NDMzMzEzIDM2MDgxNDE1MzE4NzQxNjM=