78 if ($this->scheme !== null) {
79 $scheme_obj = $registry->getScheme($this->scheme, $config, $context);
85 $def = $config->getDefinition(
'URI');
86 $scheme_obj = $def->getDefaultScheme($config, $context);
90 'Default scheme object "' . $def->defaultScheme .
'" was not readable',
109 $chars_sub_delims =
'!$&\'()*+,;=';
110 $chars_gen_delims =
':/?#[]@';
111 $chars_pchar = $chars_sub_delims .
':@';
114 if (!is_null($this->host)) {
116 $this->host = $host_def->validate($this->host, $config, $context);
117 if ($this->host ===
false) {
128 if (!is_null($this->scheme) && is_null($this->host) || $this->host ===
'') {
131 $def = $config->getDefinition(
'URI');
132 if ($def->defaultScheme === $this->scheme) {
133 $this->scheme = null;
138 if (!is_null($this->userinfo)) {
140 $this->userinfo = $encoder->encode($this->userinfo);
144 if (!is_null($this->port)) {
145 if ($this->port < 1 || $this->port > 65535) {
152 if (!is_null($this->host)) {
161 $this->path = $segments_encoder->encode($this->path);
162 } elseif ($this->path !==
'') {
163 if ($this->path[0] ===
'/') {
167 if (strlen($this->path) >= 2 && $this->path[1] ===
'/') {
174 $this->path = $segments_encoder->encode($this->path);
176 } elseif (!is_null($this->scheme)) {
180 $this->path = $segments_encoder->encode($this->path);
186 $c = strpos($this->path,
'/');
189 $segment_nc_encoder->encode(substr($this->path, 0, $c)) .
190 $segments_encoder->encode(substr($this->path, $c));
192 $this->path = $segment_nc_encoder->encode($this->path);
203 if (!is_null($this->query)) {
204 $this->query = $qf_encoder->encode($this->query);
207 if (!is_null($this->fragment)) {
208 $this->fragment = $qf_encoder->encode($this->fragment);
224 if (!is_null($this->host)) {
226 if (!is_null($this->userinfo)) {
227 $authority .= $this->userinfo .
'@';
230 if (!is_null($this->port)) {
242 if (!is_null($this->scheme)) {
243 $result .= $this->scheme .
':';
245 if (!is_null($authority)) {
249 if (!is_null($this->query)) {
252 if (!is_null($this->fragment)) {
273 if ($this->host === null) {
276 $uri_def = $config->getDefinition(
'URI');
277 if ($uri_def->host === $this->host) {
295 if (!$this->
isLocal($config, $context)) {
304 $current_scheme_obj = $config->getDefinition(
'URI')->getDefaultScheme($config, $context);
305 if ($current_scheme_obj->secure) {
306 if (!$scheme_obj->secure) {