9 namespace Fossology\Lib\Util;
28 $split = explode(
"#", $input);
29 if (count($split) > 1) {
30 $subpath =
trim($split[1],
" /");
31 $subpaths = explode(
"/", $subpath);
33 foreach ($subpaths as $sp) {
34 if ($sp !=
"." || $sp !=
"..") {
35 $subpath[] = urldecode($sp);
38 $subpath = implode(
"/", $subpath);
40 $split = explode(
"?", $split[0]);
41 if (count($split) > 1) {
43 $parts = explode(
"&", $split[1]);
44 foreach ($parts as $part) {
45 $pair = explode(
"=", $part);
46 if (empty($pair[1])) {
49 $qualifiers[$pair[0]] = urldecode($pair[1]);
52 $split = explode(
":", $split[0]);
53 $scheme = strtolower($split[0]);
54 $split = explode(
"/",
trim($split[1],
" /"));
55 $type = strtolower($split[0]);
56 $split = explode(
"@", implode(
"/", array_slice($split, 1)));
57 if (count($split) > 1) {
58 $version = urldecode($split[1]);
60 $split = explode(
"/", $split[0]);
61 $splitClone = array_values($split);
62 $name = end($splitClone);
63 $name = urldecode($name);
65 for ($i = 0; $i < count($split) - 1; $i++) {
66 $namespace[] = urldecode($split[$i]);
68 $namespace = implode(
"/", $namespace);
69 if (empty($namespace)) {
75 "namespace" => $namespace,
77 "version" => $version,
78 "qualifiers" => $qualifiers,
static fromString($input)
char * trim(char *ptext)
Trimming whitespace.