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:----hR6kU65Eb+K9/Q6YS/cE/Od7irqyI+xVuNuGiXZVc7ao9jd8wq6WCZ4jrm0Z2TGlAMAUUrbIWbew7+bKG30L+tQsYqADRsTOAiJC9dTsQpm9Gh8N6oWepTpoKsQrGlOypxyGWpbn+6zEyigcmOiOTSZajkOMqALyig4+a57YWgICj0kP5p+C/fy5LW+lXbuI1kRZUGMLuWeXIdO9HhyRFAld2On+SnPJPF+G0YrQVWBQaku4lpKfHm2z0kgr1VqWtz2A+9fC8jth7y7e1CB5j73ENIHU11zZXQpKwGDYz3pzKOYyjekHY5Wgdaqtcchs0Wxlwm/SD8rssrjiqStkSHj8uYJPfxbaF5Lg384xXyj0Ih7AJxXJRyruS27kYYcXdmzZIS/LdK7LdU0Gtn4ZGk4UsLWZYuuxnHMMJmndxAcUbVO+SRdE1uu7ZepDLbpc8+ehqEIxlkmJHhzrh+as7ac1du09Ftr96+1jlYNBGgIhdLH4qlv/amBTFmTv2IdF6Uh1mJ78Y4g38UQZvsUdw2c8hpI1SL+JJIp3GzPEMIkYR1SY0uLZQCvJaOBDXetN7csLvU0etJ/vTs9xO7PykPLpo/kDw6G4cF9hRIOWN0go/ydAzV3tztOrUoQNvPWo14qXG0s996yE6btiYaJsVd+2781Nr6LtO8M40Yp7mdk=----ATTACHMENT:----NTY5NjE1ODM5MTk2OTQ4NCA1NDMzOTExOTU3MDk1MjU4IDc4NjQ0ODAwOTg2NDk1Njc=