ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\Data\URI Class Reference

The scope of this class is split ilias-conform URI's into components. More...

+ Collaboration diagram for ILIAS\Data\URI:

Public Member Functions

 __construct (string $uri_string)
 
 getSchema ()
 
 withSchema (string $schema)
 Get URI with modified schema. More...
 
 getAuthority ()
 
 withAuthority (string $authority)
 Get URI with modified authority. More...
 
 getPort ()
 
 withPort (int $port=null)
 Get URI with modified port. More...
 
 getHost ()
 
 withHost (string $host)
 Get URI with modified host. More...
 
 getPath ()
 
 withPath (string $path=null)
 Get URI with modified path. More...
 
 getQuery ()
 
 withQuery (string $query=null)
 Get URI with modified query. More...
 
 getFragment ()
 
 withFragment (string $fragment=null)
 Get URI with modified fragment. More...
 
 getBaseURI ()
 Get a well-formed URI consisting only of schema, authority and port. More...
 
 __toString ()
 
 getParameters ()
 Get all parameters as associative array. More...
 
 getParameter (string $param)
 Get the value of the given parameter (or null) More...
 
 withParameters (array $parameters)
 Get URI with modified parameters. More...
 
 withParameter (string $key, $value)
 Get URI with modified parameters. More...
 

Protected Member Functions

 digestSchema (string $schema)
 Check schema formating. More...
 
 digestHost (string $host)
 Check host formating. More...
 
 digestPort (int $port=null)
 Check port formating. More...
 
 digestPath (string $path=null)
 Check path formating. More...
 
 digestQuery (string $query=null)
 Check query formating. More...
 
 digestFragment (string $fragment=null)
 Check fragment formating. More...
 
 checkCorrectFormatOrThrow (string $regexp, string $string)
 Check wether a string fits a regexp. More...
 

Protected Attributes

string $schema
 
string $host
 
int $port
 
string $path
 
string $query
 
string $fragment
 

Private Attributes

const PATH_DELIM = '/'
 
const ALPHA = '[A-Za-z]'
 Relevant character-groups as defined in RFC 3986 Appendix 1. More...
 
const DIGIT = '[0-9]'
 
const ALPHA_DIGIT = '[A-Za-z0-9]'
 
const HEXDIG = '[0-9A-Fa-f]'
 
const PCTENCODED = '%' . self::HEXDIG . self::HEXDIG
 
const PIMP = '[\\+\\-\\.]'
 point|minus|plus to be used in schema. More...
 
const SUBDELIMS = '[\\$,;=!&\'\\(\\)\\*\\+]'
 valid subdelims according to RFC 3986 Appendix 1: "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" More...
 
const BASEURI_SUBDELIMS = '[\\$,;&\'\\*]'
 subdelims without jsf**k characters +!() and = More...
 
const UNRESERVED = self::ALPHA_DIGIT . '|[\\-\\._~]'
 
const UNRESERVED_NO_DOT = self::ALPHA_DIGIT . '|[\\-_~]'
 
const PCHAR = self::UNRESERVED . '|' . self::SUBDELIMS . '|' . self::PCTENCODED . '|:|@'
 
const BASEURI_PCHAR = self::UNRESERVED . '|' . self::BASEURI_SUBDELIMS . '|' . self::PCTENCODED . '|:|@'
 
const SCHEMA = '#^' . self::ALPHA . '(' . self::ALPHA_DIGIT . '|' . self::PIMP . ')*$#'
 
const DOMAIN_LABEL = self::ALPHA_DIGIT . '((' . self::UNRESERVED_NO_DOT . '|' . self::PCTENCODED . '|' . self::BASEURI_SUBDELIMS . ')*' . self::ALPHA_DIGIT . ')*'
 
const HOST_REG_NAME = '^' . self::DOMAIN_LABEL . '(\\.' . self::DOMAIN_LABEL . ')*$'
 
const HOST_IPV4_EMBEDDED = '(' . self::DIGIT . '{1,3})(\\.' . self::DIGIT . '{1,3}){3}'
 
const HOST_IPV4 = '^' . self::HOST_IPV4_EMBEDDED . '$'
 
const IPV6_COUNT_COLONS = '(' . self::HEXDIG . '{1,4}:)'
 
const IPV6_COLONS_BETWEEN = '(' . self::HEXDIG . '{0,4}:' . self::HEXDIG . '{0,4})'
 
const IPV6_LEFT_SHORT = '(' . self::HEXDIG . '{1,4}|' . self::HEXDIG . '{1,4}(:' . self::HEXDIG . '{1,4})*)?'
 
const HOST_IPV6_LONG = '^\\[' . self::IPV6_COUNT_COLONS . '{7}' . self::HEXDIG . '{1,4}\\]$'
 
const HOST_IPV6_SHORT
 
const HOST_IPV6_EMBEDDED_IPV4_LONG = '^\\[' . self::IPV6_COUNT_COLONS . '{5}' . self::HEXDIG . '{1,4}:' . self::HOST_IPV4_EMBEDDED . '\\]$'
 
const HOST_IPV6_EMBEDDED_IPV4_SHORT
 
const HOST_IPV6_EMBEDDED_IPV4 = self::HOST_IPV6_EMBEDDED_IPV4_SHORT . '|' . self::HOST_IPV6_EMBEDDED_IPV4_LONG
 
const HOST_IPV6 = self::HOST_IPV6_LONG . '|' . self::HOST_IPV6_SHORT . '|' . self::HOST_IPV6_EMBEDDED_IPV4
 
const HOST = '#' . self::HOST_IPV4 . '|' . self::HOST_REG_NAME . '|' . self::HOST_IPV6 . '#'
 
const PORT = '#^' . self::DIGIT . '+$#'
 
const PATH = '#^(?!//)(?!:)(' . self::PCHAR . '|' . self::PATH_DELIM . ')+$#'
 
const QUERY = '#^(' . self::PCHAR . '|' . self::PATH_DELIM . '|\\?)+$#'
 
const FRAGMENT = '#^(' . self::PCHAR . '|' . self::PATH_DELIM . '|\\?|\\#)+$#'
 

Detailed Description

The scope of this class is split ilias-conform URI's into components.

Please refer to RFC 3986 for details. Notice, ilias-confor URI's will form a SUBSET of RFC 3986:

  • Notice the restrictions on baseuri-subdelims.
  • We require a schema and an authority to be present.
  • If any part is located and it is invalid an exception will be thrown instead of just omiting it.
  • IPv6 is now supported.
  • The IPv6 conforms to https://datatracker.ietf.org/doc/html/rfc4291#section-2.2.

Definition at line 18 of file URI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Data\URI::__construct ( string  $uri_string)

Definition at line 95 of file URI.php.

References ILIAS\Data\URI\digestFragment(), ILIAS\Data\URI\digestHost(), ILIAS\Data\URI\digestPath(), ILIAS\Data\URI\digestPort(), ILIAS\Data\URI\digestQuery(), and ILIAS\Data\URI\digestSchema().

96  {
97  $this->schema = $this->digestSchema(parse_url($uri_string, PHP_URL_SCHEME));
98  $this->host = $this->digestHost(parse_url($uri_string, PHP_URL_HOST));
99  $this->port = $this->digestPort(parse_url($uri_string, PHP_URL_PORT));
100  $this->path = $this->digestPath(parse_url($uri_string, PHP_URL_PATH));
101  $this->query = $this->digestQuery(parse_url($uri_string, PHP_URL_QUERY));
102  $this->fragment = $this->digestFragment(parse_url($uri_string, PHP_URL_FRAGMENT));
103  }
digestQuery(string $query=null)
Check query formating.
Definition: URI.php:147
digestHost(string $host)
Check host formating.
Definition: URI.php:116
digestPath(string $path=null)
Check path formating.
Definition: URI.php:132
digestPort(int $port=null)
Check port formating.
Definition: URI.php:124
digestSchema(string $schema)
Check schema formating.
Definition: URI.php:108
digestFragment(string $fragment=null)
Check fragment formating.
Definition: URI.php:158
+ Here is the call graph for this function:

Member Function Documentation

◆ __toString()

ILIAS\Data\URI::__toString ( )

Definition at line 317 of file URI.php.

References ILIAS\Data\URI\$fragment, ILIAS\Data\URI\$query, ILIAS\Data\URI\getBaseURI(), ILIAS\Data\URI\getFragment(), and ILIAS\Data\URI\getQuery().

Referenced by ILIAS\UI\Implementation\Component\Link\Bulky\__construct().

317  : string
318  {
319  $uri = $this->getBaseURI();
320  $query = $this->getQuery();
321  if ($query) {
322  $uri .= '?' . $query;
323  }
324  $fragment = $this->getFragment();
325  if ($fragment) {
326  $uri .= '#' . $fragment;
327  }
328  return $uri;
329  }
string $fragment
Definition: URI.php:93
getBaseURI()
Get a well-formed URI consisting only of schema, authority and port.
Definition: URI.php:308
getFragment()
Definition: URI.php:288
string $query
Definition: URI.php:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCorrectFormatOrThrow()

ILIAS\Data\URI::checkCorrectFormatOrThrow ( string  $regexp,
string  $string 
)
protected

Check wether a string fits a regexp.

Return it, if so, throw otherwise.

Definition at line 171 of file URI.php.

Referenced by ILIAS\Data\URI\digestFragment(), ILIAS\Data\URI\digestHost(), ILIAS\Data\URI\digestPath(), ILIAS\Data\URI\digestQuery(), ILIAS\Data\URI\digestSchema(), and ILIAS\Data\URI\withAuthority().

171  : string
172  {
173  if (preg_match($regexp, $string) === 1) {
174  return $string;
175  }
176  throw new \InvalidArgumentException('ill-formated component "' . $string . '" expected "' . $regexp . '"');
177  }
+ Here is the caller graph for this function:

◆ digestFragment()

ILIAS\Data\URI::digestFragment ( string  $fragment = null)
protected

Check fragment formating.

Return it in case of success.

Definition at line 158 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

Referenced by ILIAS\Data\URI\__construct(), and ILIAS\Data\URI\withFragment().

158  : ?string
159  {
160  if ($fragment === null) {
161  return null;
162  }
163  return $this->checkCorrectFormatOrThrow(self::FRAGMENT, $fragment);
164  }
string $fragment
Definition: URI.php:93
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:171
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ digestHost()

ILIAS\Data\URI::digestHost ( string  $host)
protected

Check host formating.

Return it in case of success.

Definition at line 116 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

Referenced by ILIAS\Data\URI\__construct(), ILIAS\Data\URI\withAuthority(), and ILIAS\Data\URI\withHost().

116  : string
117  {
118  return $this->checkCorrectFormatOrThrow(self::HOST, $host);
119  }
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:171
string $host
Definition: URI.php:89
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ digestPath()

ILIAS\Data\URI::digestPath ( string  $path = null)
protected

Check path formating.

Return it in case of success.

Definition at line 132 of file URI.php.

References ILIAS\Data\URI\$path, and ILIAS\Data\URI\checkCorrectFormatOrThrow().

Referenced by ILIAS\Data\URI\__construct(), and ILIAS\Data\URI\withPath().

132  : ?string
133  {
134  if ($path === null) {
135  return null;
136  }
137  $path = trim($this->checkCorrectFormatOrThrow(self::PATH, $path), self::PATH_DELIM);
138  if ($path === '') {
139  $path = null;
140  }
141  return $path;
142  }
string $path
Definition: URI.php:91
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:171
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ digestPort()

ILIAS\Data\URI::digestPort ( int  $port = null)
protected

Check port formating.

Return it in case of success.

Definition at line 124 of file URI.php.

Referenced by ILIAS\Data\URI\__construct(), and ILIAS\Data\URI\withPort().

124  : ?int
125  {
126  return $port ?? null;
127  }
int $port
Definition: URI.php:90
+ Here is the caller graph for this function:

◆ digestQuery()

ILIAS\Data\URI::digestQuery ( string  $query = null)
protected

Check query formating.

Return it in case of success.

Definition at line 147 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

Referenced by ILIAS\Data\URI\__construct(), and ILIAS\Data\URI\withQuery().

147  : ?string
148  {
149  if ($query === null) {
150  return null;
151  }
152  return $this->checkCorrectFormatOrThrow(self::QUERY, $query);
153  }
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:171
string $query
Definition: URI.php:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ digestSchema()

ILIAS\Data\URI::digestSchema ( string  $schema)
protected

Check schema formating.

Return it in case of success.

Definition at line 108 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

Referenced by ILIAS\Data\URI\__construct(), and ILIAS\Data\URI\withSchema().

108  : string
109  {
110  return $this->checkCorrectFormatOrThrow(self::SCHEMA, $schema);
111  }
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:171
string $schema
Definition: URI.php:88
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAuthority()

ILIAS\Data\URI::getAuthority ( )

Definition at line 195 of file URI.php.

References ILIAS\Data\URI\$port, ILIAS\Data\URI\getHost(), and ILIAS\Data\URI\getPort().

Referenced by ILIAS\Data\URI\getBaseURI().

195  : string
196  {
197  $port = $this->getPort();
198  if ($port === null) {
199  return $this->getHost();
200  }
201  return $this->getHost() . ':' . $port;
202  }
int $port
Definition: URI.php:90
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBaseURI()

ILIAS\Data\URI::getBaseURI ( )

Get a well-formed URI consisting only of schema, authority and port.

Definition at line 308 of file URI.php.

References ILIAS\Data\URI\$path, ILIAS\Data\URI\getAuthority(), ILIAS\Data\URI\getPath(), and ILIAS\Data\URI\getSchema().

Referenced by ILIAS\Data\URI\__toString().

308  : string
309  {
310  $path = $this->getPath();
311  if ($path === null) {
312  return $this->getSchema() . '://' . $this->getAuthority();
313  }
314  return $this->getSchema() . '://' . $this->getAuthority() . '/' . $path;
315  }
string $path
Definition: URI.php:91
getAuthority()
Definition: URI.php:195
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFragment()

ILIAS\Data\URI::getFragment ( )

Definition at line 288 of file URI.php.

References ILIAS\Data\URI\$fragment.

Referenced by ILIAS\Data\URI\__toString().

288  : ?string
289  {
290  return $this->fragment;
291  }
string $fragment
Definition: URI.php:93
+ Here is the caller graph for this function:

◆ getHost()

ILIAS\Data\URI::getHost ( )

Definition at line 240 of file URI.php.

References ILIAS\Data\URI\$host.

Referenced by ILIAS\Data\URI\getAuthority().

240  : string
241  {
242  return $this->host;
243  }
string $host
Definition: URI.php:89
+ Here is the caller graph for this function:

◆ getParameter()

ILIAS\Data\URI::getParameter ( string  $param)

Get the value of the given parameter (or null)

Returns
mixed|null

Definition at line 348 of file URI.php.

References $param, $params, and ILIAS\Data\URI\getParameters().

349  {
350  $params = $this->getParameters();
351 
352  return $params[$param] ?? null;
353  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getParameters()
Get all parameters as associative array.
Definition: URI.php:334
$param
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getParameters()

ILIAS\Data\URI::getParameters ( )

Get all parameters as associative array.

Definition at line 334 of file URI.php.

References $params, and ILIAS\Data\URI\getQuery().

Referenced by ILIAS\Data\URI\getParameter(), and ILIAS\Data\URI\withParameter().

334  : array
335  {
336  $params = [];
337  $query = $this->getQuery();
338  if (!is_null($query)) {
339  parse_str($query, $params);
340  }
341  return $params;
342  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
string $query
Definition: URI.php:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPath()

ILIAS\Data\URI::getPath ( )

Definition at line 256 of file URI.php.

References ILIAS\Data\URI\$path.

Referenced by ILIAS\Data\URI\getBaseURI(), and ILIAS\StaticURL\Handler\HandlerService\performRedirect().

256  : ?string
257  {
258  return $this->path;
259  }
string $path
Definition: URI.php:91
+ Here is the caller graph for this function:

◆ getPort()

ILIAS\Data\URI::getPort ( )

Definition at line 224 of file URI.php.

References ILIAS\Data\URI\$port.

Referenced by ILIAS\Data\URI\getAuthority().

224  : ?int
225  {
226  return $this->port;
227  }
int $port
Definition: URI.php:90
+ Here is the caller graph for this function:

◆ getQuery()

ILIAS\Data\URI::getQuery ( )

Definition at line 272 of file URI.php.

References ILIAS\Data\URI\$query.

Referenced by ILIAS\Data\URI\__toString(), and ILIAS\Data\URI\getParameters().

272  : ?string
273  {
274  return $this->query;
275  }
string $query
Definition: URI.php:92
+ Here is the caller graph for this function:

◆ getSchema()

ILIAS\Data\URI::getSchema ( )

Definition at line 179 of file URI.php.

References ILIAS\Data\URI\$schema.

Referenced by ILIAS\Data\URI\getBaseURI().

179  : string
180  {
181  return $this->schema;
182  }
string $schema
Definition: URI.php:88
+ Here is the caller graph for this function:

◆ withAuthority()

ILIAS\Data\URI::withAuthority ( string  $authority)

Get URI with modified authority.

Definition at line 207 of file URI.php.

References ILIAS\Data\URI\$host, $parts, ILIAS\Data\URI\$port, ILIAS\Data\URI\checkCorrectFormatOrThrow(), ILIAS\Data\URI\digestHost(), and ILIAS\Repository\int().

207  : URI
208  {
209  $parts = explode(':', $authority);
210  if (count($parts) > 2) {
211  throw new \InvalidArgumentException('ill-formated component ' . $authority);
212  }
213  $host = $this->digestHost($parts[0]);
214  $port = null;
215  if (array_key_exists(1, $parts)) {
216  $port = (int) $this->checkCorrectFormatOrThrow(self::PORT, (string) $parts[1]);
217  }
218  $other = clone $this;
219  $other->host = $host;
220  $other->port = $port;
221  return $other;
222  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
digestHost(string $host)
Check host formating.
Definition: URI.php:116
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:171
string $host
Definition: URI.php:89
int $port
Definition: URI.php:90
+ Here is the call graph for this function:

◆ withFragment()

ILIAS\Data\URI::withFragment ( string  $fragment = null)

Get URI with modified fragment.

Definition at line 296 of file URI.php.

References ILIAS\Data\URI\$fragment, and ILIAS\Data\URI\digestFragment().

296  : URI
297  {
299  $other = clone $this;
300  $other->fragment = $fragment;
301  return $other;
302  }
string $fragment
Definition: URI.php:93
digestFragment(string $fragment=null)
Check fragment formating.
Definition: URI.php:158
+ Here is the call graph for this function:

◆ withHost()

ILIAS\Data\URI::withHost ( string  $host)

Get URI with modified host.

Definition at line 248 of file URI.php.

References ILIAS\Data\URI\$host, and ILIAS\Data\URI\digestHost().

248  : URI
249  {
250  $host = $this->digestHost($host);
251  $other = clone $this;
252  $other->host = $host;
253  return $other;
254  }
digestHost(string $host)
Check host formating.
Definition: URI.php:116
string $host
Definition: URI.php:89
+ Here is the call graph for this function:

◆ withParameter()

ILIAS\Data\URI::withParameter ( string  $key,
  $value 
)

Get URI with modified parameters.

Definition at line 368 of file URI.php.

References ILIAS\LTI\ToolProvider\$key, $params, ILIAS\Data\URI\getParameters(), and ILIAS\Data\URI\withParameters().

Referenced by ILIAS\MetaData\Editor\Full\Services\Actions\LinkProvider\getLink(), KSDocumentationTreeRecursion\getNodeUri(), and ILIAS\UI\Implementation\Component\Table\Action\Action\withRowId().

368  : URI
369  {
370  $params = $this->getParameters();
371  $params[$key] = $value;
372  return $this->withParameters($params);
373  }
withParameters(array $parameters)
Get URI with modified parameters.
Definition: URI.php:358
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getParameters()
Get all parameters as associative array.
Definition: URI.php:334
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withParameters()

ILIAS\Data\URI::withParameters ( array  $parameters)

Get URI with modified parameters.

Definition at line 358 of file URI.php.

References ILIAS\Data\URI\withQuery().

Referenced by ILIAS\Data\URI\withParameter().

358  : URI
359  {
360  return $this->withQuery(
361  http_build_query($parameters)
362  );
363  }
withQuery(string $query=null)
Get URI with modified query.
Definition: URI.php:280
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withPath()

ILIAS\Data\URI::withPath ( string  $path = null)

Get URI with modified path.

Definition at line 264 of file URI.php.

References ILIAS\Data\URI\$path, and ILIAS\Data\URI\digestPath().

264  : URI
265  {
266  $path = $this->digestPath($path);
267  $other = clone $this;
268  $other->path = $path;
269  return $other;
270  }
string $path
Definition: URI.php:91
digestPath(string $path=null)
Check path formating.
Definition: URI.php:132
+ Here is the call graph for this function:

◆ withPort()

ILIAS\Data\URI::withPort ( int  $port = null)

Get URI with modified port.

Definition at line 232 of file URI.php.

References ILIAS\Data\URI\$port, and ILIAS\Data\URI\digestPort().

232  : URI
233  {
234  $port = $this->digestPort($port);
235  $other = clone $this;
236  $other->port = $port;
237  return $other;
238  }
digestPort(int $port=null)
Check port formating.
Definition: URI.php:124
int $port
Definition: URI.php:90
+ Here is the call graph for this function:

◆ withQuery()

ILIAS\Data\URI::withQuery ( string  $query = null)

Get URI with modified query.

Definition at line 280 of file URI.php.

References ILIAS\Data\URI\$query, and ILIAS\Data\URI\digestQuery().

Referenced by ILIAS\Data\URI\withParameters().

280  : URI
281  {
282  $query = $this->digestQuery($query);
283  $other = clone $this;
284  $other->query = $query;
285  return $other;
286  }
digestQuery(string $query=null)
Check query formating.
Definition: URI.php:147
string $query
Definition: URI.php:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withSchema()

ILIAS\Data\URI::withSchema ( string  $schema)

Get URI with modified schema.

Definition at line 187 of file URI.php.

References ILIAS\Data\URI\$schema, and ILIAS\Data\URI\digestSchema().

187  : URI
188  {
189  $shema = $this->digestSchema($schema);
190  $other = clone $this;
191  $other->schema = $schema;
192  return $other;
193  }
string $schema
Definition: URI.php:88
digestSchema(string $schema)
Check schema formating.
Definition: URI.php:108
+ Here is the call graph for this function:

Field Documentation

◆ $fragment

string ILIAS\Data\URI::$fragment
protected

◆ $host

string ILIAS\Data\URI::$host
protected

◆ $path

string ILIAS\Data\URI::$path
protected

◆ $port

int ILIAS\Data\URI::$port
protected

◆ $query

string ILIAS\Data\URI::$query
protected

◆ $schema

string ILIAS\Data\URI::$schema
protected

Definition at line 88 of file URI.php.

Referenced by ILIAS\Data\URI\getSchema(), and ILIAS\Data\URI\withSchema().

◆ ALPHA

const ILIAS\Data\URI::ALPHA = '[A-Za-z]'
private

Relevant character-groups as defined in RFC 3986 Appendix 1.

Definition at line 25 of file URI.php.

◆ ALPHA_DIGIT

const ILIAS\Data\URI::ALPHA_DIGIT = '[A-Za-z0-9]'
private

Definition at line 27 of file URI.php.

◆ BASEURI_PCHAR

const ILIAS\Data\URI::BASEURI_PCHAR = self::UNRESERVED . '|' . self::BASEURI_SUBDELIMS . '|' . self::PCTENCODED . '|:|@'
private

Definition at line 49 of file URI.php.

◆ BASEURI_SUBDELIMS

const ILIAS\Data\URI::BASEURI_SUBDELIMS = '[\\$,;&\'\\*]'
private

subdelims without jsf**k characters +!() and =

Definition at line 43 of file URI.php.

◆ DIGIT

const ILIAS\Data\URI::DIGIT = '[0-9]'
private

Definition at line 26 of file URI.php.

◆ DOMAIN_LABEL

const ILIAS\Data\URI::DOMAIN_LABEL = self::ALPHA_DIGIT . '((' . self::UNRESERVED_NO_DOT . '|' . self::PCTENCODED . '|' . self::BASEURI_SUBDELIMS . ')*' . self::ALPHA_DIGIT . ')*'
private

Definition at line 52 of file URI.php.

◆ FRAGMENT

const ILIAS\Data\URI::FRAGMENT = '#^(' . self::PCHAR . '|' . self::PATH_DELIM . '|\\?|\\#)+$#'
private

Definition at line 86 of file URI.php.

◆ HEXDIG

const ILIAS\Data\URI::HEXDIG = '[0-9A-Fa-f]'
private

Definition at line 28 of file URI.php.

◆ HOST

const ILIAS\Data\URI::HOST = '#' . self::HOST_IPV4 . '|' . self::HOST_REG_NAME . '|' . self::HOST_IPV6 . '#'
private

Definition at line 82 of file URI.php.

◆ HOST_IPV4

const ILIAS\Data\URI::HOST_IPV4 = '^' . self::HOST_IPV4_EMBEDDED . '$'
private

Definition at line 55 of file URI.php.

◆ HOST_IPV4_EMBEDDED

const ILIAS\Data\URI::HOST_IPV4_EMBEDDED = '(' . self::DIGIT . '{1,3})(\\.' . self::DIGIT . '{1,3}){3}'
private

Definition at line 54 of file URI.php.

◆ HOST_IPV6

const ILIAS\Data\URI::HOST_IPV6 = self::HOST_IPV6_LONG . '|' . self::HOST_IPV6_SHORT . '|' . self::HOST_IPV6_EMBEDDED_IPV4
private

Definition at line 81 of file URI.php.

◆ HOST_IPV6_EMBEDDED_IPV4

const ILIAS\Data\URI::HOST_IPV6_EMBEDDED_IPV4 = self::HOST_IPV6_EMBEDDED_IPV4_SHORT . '|' . self::HOST_IPV6_EMBEDDED_IPV4_LONG
private

Definition at line 79 of file URI.php.

◆ HOST_IPV6_EMBEDDED_IPV4_LONG

const ILIAS\Data\URI::HOST_IPV6_EMBEDDED_IPV4_LONG = '^\\[' . self::IPV6_COUNT_COLONS . '{5}' . self::HEXDIG . '{1,4}:' . self::HOST_IPV4_EMBEDDED . '\\]$'
private

Definition at line 71 of file URI.php.

◆ HOST_IPV6_EMBEDDED_IPV4_SHORT

const ILIAS\Data\URI::HOST_IPV6_EMBEDDED_IPV4_SHORT
private
Initial value:
= '^\\[(?=' . self::IPV6_COLONS_BETWEEN . '{2,6}' . self::HOST_IPV4_EMBEDDED . '\\]$)' .
self::IPV6_LEFT_SHORT . '::' .
'(' . self::HEXDIG . '{1,4}|(' . self::HEXDIG . '{1,4}:)*' . self::HEXDIG . '{0,4})?' . self::HOST_IPV4_EMBEDDED . '\\]$'

Definition at line 73 of file URI.php.

◆ HOST_IPV6_LONG

const ILIAS\Data\URI::HOST_IPV6_LONG = '^\\[' . self::IPV6_COUNT_COLONS . '{7}' . self::HEXDIG . '{1,4}\\]$'
private

Definition at line 63 of file URI.php.

◆ HOST_IPV6_SHORT

const ILIAS\Data\URI::HOST_IPV6_SHORT
private
Initial value:
= '^\\[(?=' . self::IPV6_COLONS_BETWEEN . '{2,7}\\]$)' .
self::IPV6_LEFT_SHORT . '::' .
'(' . self::HEXDIG . '{1,4}|(' . self::HEXDIG . '{1,4}:)*' . self::HEXDIG . '{1,4})?\\]$'

Definition at line 65 of file URI.php.

◆ HOST_REG_NAME

const ILIAS\Data\URI::HOST_REG_NAME = '^' . self::DOMAIN_LABEL . '(\\.' . self::DOMAIN_LABEL . ')*$'
private

Definition at line 53 of file URI.php.

◆ IPV6_COLONS_BETWEEN

const ILIAS\Data\URI::IPV6_COLONS_BETWEEN = '(' . self::HEXDIG . '{0,4}:' . self::HEXDIG . '{0,4})'
private

Definition at line 58 of file URI.php.

◆ IPV6_COUNT_COLONS

const ILIAS\Data\URI::IPV6_COUNT_COLONS = '(' . self::HEXDIG . '{1,4}:)'
private

Definition at line 57 of file URI.php.

◆ IPV6_LEFT_SHORT

const ILIAS\Data\URI::IPV6_LEFT_SHORT = '(' . self::HEXDIG . '{1,4}|' . self::HEXDIG . '{1,4}(:' . self::HEXDIG . '{1,4})*)?'
private

Definition at line 59 of file URI.php.

◆ PATH

const ILIAS\Data\URI::PATH = '#^(?!//)(?!:)(' . self::PCHAR . '|' . self::PATH_DELIM . ')+$#'
private

Definition at line 84 of file URI.php.

◆ PATH_DELIM

const ILIAS\Data\URI::PATH_DELIM = '/'
private

Definition at line 20 of file URI.php.

◆ PCHAR

const ILIAS\Data\URI::PCHAR = self::UNRESERVED . '|' . self::SUBDELIMS . '|' . self::PCTENCODED . '|:|@'
private

Definition at line 48 of file URI.php.

◆ PCTENCODED

const ILIAS\Data\URI::PCTENCODED = '%' . self::HEXDIG . self::HEXDIG
private

Definition at line 29 of file URI.php.

◆ PIMP

const ILIAS\Data\URI::PIMP = '[\\+\\-\\.]'
private

point|minus|plus to be used in schema.

Definition at line 33 of file URI.php.

◆ PORT

const ILIAS\Data\URI::PORT = '#^' . self::DIGIT . '+$#'
private

Definition at line 83 of file URI.php.

◆ QUERY

const ILIAS\Data\URI::QUERY = '#^(' . self::PCHAR . '|' . self::PATH_DELIM . '|\\?)+$#'
private

Definition at line 85 of file URI.php.

◆ SCHEMA

const ILIAS\Data\URI::SCHEMA = '#^' . self::ALPHA . '(' . self::ALPHA_DIGIT . '|' . self::PIMP . ')*$#'
private

Definition at line 51 of file URI.php.

◆ SUBDELIMS

const ILIAS\Data\URI::SUBDELIMS = '[\\$,;=!&\'\\(\\)\\*\\+]'
private

valid subdelims according to RFC 3986 Appendix 1: "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "="

Definition at line 39 of file URI.php.

◆ UNRESERVED

const ILIAS\Data\URI::UNRESERVED = self::ALPHA_DIGIT . '|[\\-\\._~]'
private

Definition at line 45 of file URI.php.

◆ UNRESERVED_NO_DOT

const ILIAS\Data\URI::UNRESERVED_NO_DOT = self::ALPHA_DIGIT . '|[\\-_~]'
private

Definition at line 46 of file URI.php.


The documentation for this class was generated from the following file: