Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/query/PhabricatorRepositoryQuery.php
| Show First 20 Lines • Show All 683 Lines • ▼ Show 20 Lines | private function getNormalizedURIs() { | ||||
| $normalized_uris = array(); | $normalized_uris = array(); | ||||
| // Since we don't know which type of repository this URI is in the general | // Since we don't know which type of repository this URI is in the general | ||||
| // case, just generate all the normalizations. We could refine this in some | // case, just generate all the normalizations. We could refine this in some | ||||
| // cases: if the query specifies VCS types, or the URI is a git-style URI | // cases: if the query specifies VCS types, or the URI is a git-style URI | ||||
| // or an `svn+ssh` URI, we could deduce how to normalize it. However, this | // or an `svn+ssh` URI, we could deduce how to normalize it. However, this | ||||
| // would be more complicated and it's not clear if it matters in practice. | // would be more complicated and it's not clear if it matters in practice. | ||||
| $types = PhabricatorRepositoryURINormalizer::getAllURITypes(); | $domain_map = PhabricatorRepositoryURI::getURINormalizerDomainMap(); | ||||
| $types = ArcanistRepositoryURINormalizer::getAllURITypes(); | |||||
| foreach ($this->uris as $uri) { | foreach ($this->uris as $uri) { | ||||
| foreach ($types as $type) { | foreach ($types as $type) { | ||||
| $normalized_uri = new PhabricatorRepositoryURINormalizer($type, $uri); | $normalized_uri = new ArcanistRepositoryURINormalizer($type, $uri); | ||||
| $normalized_uri->setDomainMap($domain_map); | |||||
| $normalized_uris[] = $normalized_uri->getNormalizedURI(); | $normalized_uris[] = $normalized_uri->getNormalizedURI(); | ||||
| } | } | ||||
| } | } | ||||
| return array_unique($normalized_uris); | return array_unique($normalized_uris); | ||||
| } | } | ||||
| } | } | ||||