1
0
Fork 0

Allow configuring a path repo to an empty path as long as using wildcards and the wildcard root exists, fixes #8679

pull/8686/head
Jordi Boggiano 2020-03-11 15:33:14 +01:00
parent 3e82542812
commit d559bf5387
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 11 additions and 0 deletions

View File

@ -128,6 +128,17 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn
$urlMatches = $this->getUrlMatches();
if (empty($urlMatches)) {
if (preg_match('{[*{}]}', $this->url)) {
$url = $this->url;
while (preg_match('{[*{}]}', $url)) {
$url = dirname($url);
}
// the parent directory before any wildcard exists, so we assume it is correctly configured but simply empty
if (is_dir($url)) {
return;
}
}
throw new \RuntimeException('The `url` supplied for the path (' . $this->url . ') repository does not exist');
}