ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 34 of file URI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 111 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().

112  {
113  $this->schema = $this->digestSchema(parse_url($uri_string, PHP_URL_SCHEME));
114  $this->host = $this->digestHost(parse_url($uri_string, PHP_URL_HOST));
115  $this->port = $this->digestPort(parse_url($uri_string, PHP_URL_PORT));
116  $this->path = $this->digestPath(parse_url($uri_string, PHP_URL_PATH));
117  $this->query = $this->digestQuery(parse_url($uri_string, PHP_URL_QUERY));
118  $this->fragment = $this->digestFragment(parse_url($uri_string, PHP_URL_FRAGMENT));
119  }
digestQuery(string $query=null)
Check query formating.
Definition: URI.php:163
digestHost(string $host)
Check host formating.
Definition: URI.php:132
digestPath(string $path=null)
Check path formating.
Definition: URI.php:148
digestPort(int $port=null)
Check port formating.
Definition: URI.php:140
digestSchema(string $schema)
Check schema formating.
Definition: URI.php:124
digestFragment(string $fragment=null)
Check fragment formating.
Definition: URI.php:174
+ Here is the call graph for this function:

Member Function Documentation

◆ __toString()

ILIAS\Data\URI::__toString ( )

Definition at line 333 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().

333  : string
334  {
335  $uri = $this->getBaseURI();
336  $query = $this->getQuery();
337  if ($query) {
338  $uri .= '?' . $query;
339  }
340  $fragment = $this->getFragment();
341  if ($fragment) {
342  $uri .= '#' . $fragment;
343  }
344  return $uri;
345  }
string $fragment
Definition: URI.php:109
getBaseURI()
Get a well-formed URI consisting only of schema, authority and port.
Definition: URI.php:324
getFragment()
Definition: URI.php:304
string $query
Definition: URI.php:108
+ 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 187 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().

187  : string
188  {
189  if (preg_match($regexp, $string) === 1) {
190  return $string;
191  }
192  throw new \InvalidArgumentException('ill-formated component "' . $string . '" expected "' . $regexp . '"');
193  }
+ 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 174 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

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

174  : ?string
175  {
176  if ($fragment === null) {
177  return null;
178  }
179  return $this->checkCorrectFormatOrThrow(self::FRAGMENT, $fragment);
180  }
string $fragment
Definition: URI.php:109
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:187
+ 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 132 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

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

132  : string
133  {
134  return $this->checkCorrectFormatOrThrow(self::HOST, $host);
135  }
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:187
string $host
Definition: URI.php:105
+ 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 148 of file URI.php.

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

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

148  : ?string
149  {
150  if ($path === null) {
151  return null;
152  }
153  $path = trim($this->checkCorrectFormatOrThrow(self::PATH, $path), self::PATH_DELIM);
154  if ($path === '') {
155  $path = null;
156  }
157  return $path;
158  }
string $path
Definition: URI.php:107
const PATH
Definition: proxy_ylocal.php:8
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:187
+ 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 140 of file URI.php.

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

140  : ?int
141  {
142  return $port ?? null;
143  }
int $port
Definition: URI.php:106
+ 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 163 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

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

163  : ?string
164  {
165  if ($query === null) {
166  return null;
167  }
168  return $this->checkCorrectFormatOrThrow(self::QUERY, $query);
169  }
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:187
string $query
Definition: URI.php:108
+ 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 124 of file URI.php.

References ILIAS\Data\URI\checkCorrectFormatOrThrow().

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

124  : string
125  {
126  return $this->checkCorrectFormatOrThrow(self::SCHEMA, $schema);
127  }
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:187
string $schema
Definition: URI.php:104
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAuthority()

ILIAS\Data\URI::getAuthority ( )

Definition at line 211 of file URI.php.

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

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

211  : string
212  {
213  $port = $this->getPort();
214  if ($port === null) {
215  return $this->getHost();
216  }
217  return $this->getHost() . ':' . $port;
218  }
int $port
Definition: URI.php:106
+ 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 324 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().

324  : string
325  {
326  $path = $this->getPath();
327  if ($path === null) {
328  return $this->getSchema() . '://' . $this->getAuthority();
329  }
330  return $this->getSchema() . '://' . $this->getAuthority() . '/' . $path;
331  }
string $path
Definition: URI.php:107
getAuthority()
Definition: URI.php:211
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFragment()

ILIAS\Data\URI::getFragment ( )

Definition at line 304 of file URI.php.

References ILIAS\Data\URI\$fragment.

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

304  : ?string
305  {
306  return $this->fragment;
307  }
string $fragment
Definition: URI.php:109
+ Here is the caller graph for this function:

◆ getHost()

ILIAS\Data\URI::getHost ( )

Definition at line 256 of file URI.php.

References ILIAS\Data\URI\$host.

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

256  : string
257  {
258  return $this->host;
259  }
string $host
Definition: URI.php:105
+ 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 364 of file URI.php.

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

365  {
366  $params = $this->getParameters();
367 
368  return $params[$param] ?? null;
369  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getParameters()
Get all parameters as associative array.
Definition: URI.php:350
$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 350 of file URI.php.

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

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

350  : array
351  {
352  $params = [];
353  $query = $this->getQuery();
354  if (!is_null($query)) {
355  parse_str($query, $params);
356  }
357  return $params;
358  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
string $query
Definition: URI.php:108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPath()

ILIAS\Data\URI::getPath ( )

Definition at line 272 of file URI.php.

References ILIAS\Data\URI\$path.

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

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

◆ getPort()

ILIAS\Data\URI::getPort ( )

Definition at line 240 of file URI.php.

References ILIAS\Data\URI\$port.

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

240  : ?int
241  {
242  return $this->port;
243  }
int $port
Definition: URI.php:106
+ Here is the caller graph for this function:

◆ getQuery()

ILIAS\Data\URI::getQuery ( )

Definition at line 288 of file URI.php.

References ILIAS\Data\URI\$query.

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

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

◆ getSchema()

ILIAS\Data\URI::getSchema ( )

Definition at line 195 of file URI.php.

References ILIAS\Data\URI\$schema.

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

195  : string
196  {
197  return $this->schema;
198  }
string $schema
Definition: URI.php:104
+ Here is the caller graph for this function:

◆ withAuthority()

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

Get URI with modified authority.

Definition at line 223 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().

223  : URI
224  {
225  $parts = explode(':', $authority);
226  if (count($parts) > 2) {
227  throw new \InvalidArgumentException('ill-formated component ' . $authority);
228  }
229  $host = $this->digestHost($parts[0]);
230  $port = null;
231  if (array_key_exists(1, $parts)) {
232  $port = (int) $this->checkCorrectFormatOrThrow(self::PORT, (string) $parts[1]);
233  }
234  $other = clone $this;
235  $other->host = $host;
236  $other->port = $port;
237  return $other;
238  }
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:132
checkCorrectFormatOrThrow(string $regexp, string $string)
Check wether a string fits a regexp.
Definition: URI.php:187
string $host
Definition: URI.php:105
int $port
Definition: URI.php:106
+ Here is the call graph for this function:

◆ withFragment()

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

Get URI with modified fragment.

Definition at line 312 of file URI.php.

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

312  : URI
313  {
315  $other = clone $this;
316  $other->fragment = $fragment;
317  return $other;
318  }
string $fragment
Definition: URI.php:109
digestFragment(string $fragment=null)
Check fragment formating.
Definition: URI.php:174
+ Here is the call graph for this function:

◆ withHost()

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

Get URI with modified host.

Definition at line 264 of file URI.php.

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

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

◆ withParameter()

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

Get URI with modified parameters.

Definition at line 384 of file URI.php.

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

Referenced by KSDocumentationTreeRecursion\getNodeUri().

384  : URI
385  {
386  $params = $this->getParameters();
387  $params[$key] = $value;
388  return $this->withParameters($params);
389  }
withParameters(array $parameters)
Get URI with modified parameters.
Definition: URI.php:374
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
getParameters()
Get all parameters as associative array.
Definition: URI.php:350
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 374 of file URI.php.

References ILIAS\Data\URI\withQuery().

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

374  : URI
375  {
376  return $this->withQuery(
377  http_build_query($parameters)
378  );
379  }
withQuery(string $query=null)
Get URI with modified query.
Definition: URI.php:296
+ 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 280 of file URI.php.

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

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

◆ withPort()

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

Get URI with modified port.

Definition at line 248 of file URI.php.

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

248  : URI
249  {
250  $port = $this->digestPort($port);
251  $other = clone $this;
252  $other->port = $port;
253  return $other;
254  }
digestPort(int $port=null)
Check port formating.
Definition: URI.php:140
int $port
Definition: URI.php:106
+ Here is the call graph for this function:

◆ withQuery()

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

Get URI with modified query.

Definition at line 296 of file URI.php.

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

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

296  : URI
297  {
298  $query = $this->digestQuery($query);
299  $other = clone $this;
300  $other->query = $query;
301  return $other;
302  }
digestQuery(string $query=null)
Check query formating.
Definition: URI.php:163
string $query
Definition: URI.php:108
+ 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 203 of file URI.php.

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

203  : URI
204  {
205  $shema = $this->digestSchema($schema);
206  $other = clone $this;
207  $other->schema = $schema;
208  return $other;
209  }
string $schema
Definition: URI.php:104
digestSchema(string $schema)
Check schema formating.
Definition: URI.php:124
+ 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 104 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 41 of file URI.php.

◆ ALPHA_DIGIT

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

Definition at line 43 of file URI.php.

◆ BASEURI_PCHAR

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

Definition at line 65 of file URI.php.

◆ BASEURI_SUBDELIMS

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

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

Definition at line 59 of file URI.php.

◆ DIGIT

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

Definition at line 42 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 68 of file URI.php.

◆ FRAGMENT

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

Definition at line 102 of file URI.php.

◆ HEXDIG

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

Definition at line 44 of file URI.php.

◆ HOST

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

Definition at line 98 of file URI.php.

◆ HOST_IPV4

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

Definition at line 71 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 70 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 97 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 95 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 87 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 89 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 79 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 81 of file URI.php.

◆ HOST_REG_NAME

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

Definition at line 69 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 74 of file URI.php.

◆ IPV6_COUNT_COLONS

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

Definition at line 73 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 75 of file URI.php.

◆ PATH

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

Definition at line 100 of file URI.php.

◆ PATH_DELIM

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

Definition at line 36 of file URI.php.

◆ PCHAR

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

Definition at line 64 of file URI.php.

◆ PCTENCODED

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

Definition at line 45 of file URI.php.

◆ PIMP

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

point|minus|plus to be used in schema.

Definition at line 49 of file URI.php.

◆ PORT

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

Definition at line 99 of file URI.php.

◆ QUERY

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

Definition at line 101 of file URI.php.

◆ SCHEMA

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

Definition at line 67 of file URI.php.

◆ SUBDELIMS

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

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

Definition at line 55 of file URI.php.

◆ UNRESERVED

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

Definition at line 61 of file URI.php.

◆ UNRESERVED_NO_DOT

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

Definition at line 62 of file URI.php.


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