function UriResolver::parse
Parses a URI into five main components
Parameters
string $uri:
Return value
array
2 calls to UriResolver::parse()
- UriResolver::isValid in vendor/
justinrainbow/ json-schema/ src/ JsonSchema/ Uri/ UriResolver.php - UriResolver::resolve in vendor/
justinrainbow/ json-schema/ src/ JsonSchema/ Uri/ UriResolver.php - Resolves a URI
File
-
vendor/
justinrainbow/ json-schema/ src/ JsonSchema/ Uri/ UriResolver.php, line 29
Class
- UriResolver
- Resolves JSON Schema URIs
Namespace
JsonSchema\UriCode
public function parse($uri) {
preg_match('|^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?|', $uri, $match);
$components = array();
if (5 < count($match)) {
$components = array(
'scheme' => $match[2],
'authority' => $match[4],
'path' => $match[5],
);
}
if (7 < count($match)) {
$components['query'] = $match[7];
}
if (9 < count($match)) {
$components['fragment'] = $match[9];
}
return $components;
}