MMO\core\uris
MMO\core\uris · 16 symbols · generated 5 Oct 2026
absolute
uris.php:397Fill in whatever $uri is missing (scheme, host/user/pass/port, path) from $root.
- Namespace
MMO\core\uris
| $uri | array | string | |
| $root | array | string | the root uri to fill in from |
| $strict = true | bool | if false, $uri's own scheme (if any) is kept even when it differs from $root's; if true (default), $root is only applied when the schemes match (or $uri has none) |
| $join = true | bool | if true, return a joined string; if false, return the parts array |
| returns | array | string |
Call graph
Used by (2)
apiQuery
uris.php:312Build a query string in the {json:api} convention (filters[...], sort=, fields=, page[limit]/page[offset]).
- Namespace
MMO\core\uris
| $filters = null | array | string | null | a raw filters string, or ['field' => value, ...] |
| $fields = null | array | string | null | a raw fields string, or ['field' => bool, ...] (false prefixes with -) |
| $sort = null | array | string | null | a raw sort string, or ['field' => bool, ...] (false -> descending, prefixed with -) |
| $limit = null | null | int | |
| $offset = null | null | int | |
| $search = null | null | array | |
| returns | string | a query string, NOT prefixed with '?' |
Call graph
buildQuery
uris.php:242Same as \http_build_query(), except it can round-trip true (encoded as a bare key, no =value) and null (encoded as key=NULL) -- \http_build_query() alone can't distinguish those from '1'/''.
- Namespace
MMO\core\uris
Call graph
Used by (3)
extension
uris.php:95Extract the extension from a uri's path (query/fragment are stripped first, so they don't interfere).
- Namespace
MMO\core\uris
Call graph
hasAuthority
uris.php:50Tells if a uri has a scheme:// authority part at all (of any scheme).
- Namespace
MMO\core\uris
| $uri | string | |
| returns |
Call graph
hasLocalAuthority
uris.php:64Tells if a uri's scheme is one of this framework's "local" schemes (Uri::$LOCAL_SCHEMES, e.g. 'file'/'phar') -- these are treated specially throughout this file (their authority is not a real network host, so it's folded back into the path instead -- path()/split()).
- Namespace
MMO\core\uris
| $uri | string | |
| returns |
Call graph
Used by (1)
isAbsolute
uris.php:81Tells if a uri is absolute: it has a network authority (scheme://host/..., or -- in $strict mode -- a local-scheme authority followed by /), or (falling back to isAbsoluteFilename()) it looks like an absolute filesystem path.
- Namespace
MMO\core\uris
| $uri | string | |
| $strict = true | bool | if false, any scheme://... (local scheme or not) counts as absolute regardless of what follows the authority |
| returns |
join
uris.php:206Reverse of split(): join a parts array back into a uri string.
- Namespace
MMO\core\uris
matchMask
uris.php:359Try to match an uri against a mask.
- Namespace
MMO\core\uris
| $mask | array | string | a split (or splittable) uri whose 'path'/'query' are matched with the dedicated path/query matchers (matchMask()/matchMask()), and any other part (scheme, host, port, user, pass, fragment) is matched generically |
| $uri | array | string | a split (or splittable) uri to test |
| $matches = null | null | array | |
| $schemas = null | null | array | a list of schemas to use for the type in placeholders. if null, use the global schemas |
| returns | string | true | true if it matches or the mask item key on which the uri has failed to match. |
path
uris.php:21Extract just the path component of a uri (stripping scheme/authority/query/fragment). A cheaper shortcut for split($uri)['path'] when you don't need the rest of the uri parsed.
- Namespace
MMO\core\uris
| $uri | string | |
| $isWindows = null | null | bool | if null, auto-detected: a non-authority uri that looks like a Windows filename (isWindowsFilename()) is normalized (\ -> /) |
| returns | string |
Call graph
Used by (1)
relative
uris.php:452The reverse of absolute(): strip out from $uri whatever it shares with $root (scheme, host/user/pass, matching port, and the common leading part of the path -- relative()), so re-applying absolute($result, $root) recovers $uri.
- Namespace
MMO\core\uris
| $uri | ||
| $root | ||
| $strict = false | bool | passed to \MMO\core\paths\relative(): if true, $uri's path must be a descendant of $root's (no leading .. allowed in the result) |
| $join = true | bool | if true, return a joined string; if false, return the parts array |
| returns | false if $uri and $root have different hosts (they share no common base at all) |
resolve
uris.php:511Resolve $uri against a base uri and simplify the resulting path -- a direct implementation of RFC 3986's reference resolution algorithm (unlike absolute(), this correctly treats $base's path as a DOCUMENT, dropping everything after its last '/' before applying $uri, exactly like a browser resolving a relative link).
- Namespace
MMO\core\uris
| $uri | ||
| $base | the base uri to resolve against | |
| $strict = true | bool | passed to absolute(): if false, allow $uri's own scheme to be kept even when it's relative to $base with a different scheme |
| $join = true | bool | if true, return a joined string; if false, return the parts array |
| returns |
Call graph
simplify
uris.php:110Simplify a uri's path component in place (resolving ./.. -- simplify()), leaving the rest of the uri untouched.
- Namespace
MMO\core\uris
| $uri | string | |
| $join = true | bool | if true, return a joined string; if false, return the split parts array |
| returns |
split
uris.php:133Parse a uri into its RFC 3986 parts. Only the parts actually present in $uri are set (e.g. a path-only uri yields just ['path' => ...]); the query string is itself parsed into an array (splitQuery()).
- Namespace
MMO\core\uris
| $uri | string | |
| $isWindows = MMO\core\uris\IS_WINDOWS | bool | if true, the path part is normalized (\ -> /) |
| returns | array | a subset of: scheme, user, pass, host, port, path, query, fragment |
splitQuery
uris.php:275- Namespace
MMO\core\uris
unresolve
uris.php:536The reverse of resolve(): recover the relative uri that, resolved against $base, would produce $uri.
- Namespace
MMO\core\uris
| $uri | ||
| $base | ||
| $strict = false | bool | if true, don't allow the result's path to start with .. (i.e. $uri's path must be a descendant of $base's directory); if false (default), .. is allowed |
| $join = true | bool | if true, return a joined string; if false, return the parts array |
| returns | false in strict mode if $uri can't be expressed without a leading .. |