Copied!

.------------------------------------------------------------------.
| NUL + . / ; ? & # |
|------------------------------------------------------------------|
| first | "" "" "." "/" ";" "?" "&" "#" |
| sep | "," "," "." "/" ";" "&" "&" "," |
| named | false false false false true true true false |
| ifemp | "" "" "" "" "" "=" "=" "" |
| allow | U U+R U U U U U U+R |
`------------------------------------------------------------------'

named = false
| 1 | {/list} /red,green,blue | {$value}(?:,{$value}+)
| 2 | {/list} /red/green/blue | {$value}+(?:{$sep}{$value}+)
| 3 | {/keys} /semi,%3B,dot,.,comma,%2C | /(\w+,?)+
| 4 | {/keys} /semi=%3B/dot=./comma=%2C | /(?:\w+=\w+/?)
named = true
| 1 | {?list} ?list=red,green,blue | {name}=(?:\w+(?:,\w+?))
| 2 | {?list} ?list=red&list=green&list=blue | {name}+=(?:{$value}+(?:{sep}{name}+={$value}))
| 3 | {?keys} ?keys=semi,%3B,dot,.,comma,%2C | (same as 1)
| 4 | {?keys
} ?semi=%3B&dot=.&comma=%2C | (same as 2)

UNRESERVED

RFC 1738 ALPHA | DIGIT | "-" | "." | "" | | "$" | "+" | "!" | "*" | "'" | "(" | ")" | ","
RFC 3986 ALPHA | DIGIT | "-" | "." | "
" | "~"
RFC 6570 ALPHA | DIGIT | "-" | "." | "_" | "~"

RESERVED

RFC 1738 ":" | "/" | "?" | | "@" | "!" | "$" | "&" | "'" | "(" | ")" | "" | "+" | "," | ";" | "=" | "-" | "_" | "." |
RFC 3986 ":" | "/" | "?" | "#" | "[" | "]" | "@" | "!" | "$" | "&" | "'" | "(" | ")" | "
" | "+" | "," | ";" | "="
RFC 6570 ":" | "/" | "?" | "#" | "[" | "]" | "@" | "!" | "$" | "&" | "'" | "(" | ")" | "*" | "+" | "," | ";" | "="

PHP_QUERY_RFC3986 was added in PHP 5.4.0

Abstract
Properties
public $empty
public $first
public $id
 

start - Variable offset position, level-2 operators start at 1

    (exclude operator itself, e.g. {?query})

first - If variables found, prepend this value to it
named - Whether or not the expansion includes the variable or key name
reserved - union of (unreserved / reserved / pct-encoded)

public $named
public $reserved
public static $reserved_chars = [ '%3A' => ':' , '%2F' => '/' , '%3F' => '?' , '%23' => '#' , '%5B' => '[' , '%5D' => ']' , '%40' => '@' , '%21' => '!' , '%24' => '$' , '%26' => '&' , '%27' => ''' , '%28' => '(' , '%29' => ')' , '%2A' => '*' , '%2B' => '+' , '%2C' => ',' , '%3B' => ';' , '%3D' => '=' ]
 

gen-delims | sub-delims

public $sep
public $start
Methods
public __construct ( $id , $named , $sep , $empty , $reserved , $start , $first )
public static createById ( $id )
public decode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $values )
 

Decodes variable

  • return string decoded string
public encode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $values )
 

Encodes variable according to spec (reserved or unreserved)

  • return string encoded string
public expand ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , array $params = [ ] )
public expandExplode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , array $val )
 

Explode modifier '*', '%'

  • return null | string
public expandNonExplode ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , array $val )
 

Non explode modifier ':'

  • return null | string
public expandString ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $val )
public extract ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var , $data )
 

Extracts value from variable

  • return string
public static isValid ( $id )
public abstract toRegex ( Rize\UriTemplate\Parser $parser , Rize\UriTemplate\Node\Variable $var )
Properties
protected static $loaded
protected static $pathRegex = '(?:[a-zA-Z0-9\-\._~!\$&'\(\)\*\+,;=%:@]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed path characters regex except the path delimiter '/'.

  • var string
protected static $queryRegex = '(?:[a-zA-Z0-9\-\._~!\$'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed query characters regex except the query parameter delimiter '&'.

  • var string
protected static $types = [ '' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 0 , 'first' => NULL ] , '+' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => NULL ] , '.' => [ 'sep' => '.' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '.' ] , '/' => [ 'sep' => '/' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '/' ] , ';' => [ 'sep' => ';' , 'named' => true , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => ';' ] , '?' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '?' ] , '&' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '&' ] , '#' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => '#' ] ]
Methods
protected getRegex ()
 

Returns the correct regex given the variable location in the URI

  • return string
Properties
protected static $loaded
protected static $pathRegex = '(?:[a-zA-Z0-9\-\._~!\$&'\(\)\*\+,;=%:@]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed path characters regex except the path delimiter '/'.

  • var string
protected static $queryRegex = '(?:[a-zA-Z0-9\-\._~!\$'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))'
 

RFC 3986 Allowed query characters regex except the query parameter delimiter '&'.

  • var string
public static $reserved_chars = [ '%3A' => ':' , '%2F' => '/' , '%3F' => '?' , '%23' => '#' , '%5B' => '[' , '%5D' => ']' , '%40' => '@' , '%21' => '!' , '%24' => '$' , '%26' => '&' , '%27' => ''' , '%28' => '(' , '%29' => ')' , '%2A' => '*' , '%2B' => '+' , '%2C' => ',' , '%3B' => ';' , '%3D' => '=' ]
 

gen-delims | sub-delims

protected static $types = [ '' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 0 , 'first' => NULL ] , '+' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => NULL ] , '.' => [ 'sep' => '.' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '.' ] , '/' => [ 'sep' => '/' , 'named' => false , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => '/' ] , ';' => [ 'sep' => ';' , 'named' => true , 'empty' => '' , 'reserved' => false , 'start' => 1 , 'first' => ';' ] , '?' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '?' ] , '&' => [ 'sep' => '&' , 'named' => true , 'empty' => '=' , 'reserved' => false , 'start' => 1 , 'first' => '&' ] , '#' => [ 'sep' => ',' , 'named' => false , 'empty' => '' , 'reserved' => true , 'start' => 1 , 'first' => '#' ] ]
Methods
public static createById ( $id )
public static isValid ( $id )
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only