1
0
Fork 0

Merge branch 'master' into 2.0

pull/8702/head
Jordi Boggiano 2020-03-13 11:18:23 +01:00
commit e15f7d6bb7
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
5 changed files with 37 additions and 3 deletions

View File

@ -336,7 +336,7 @@ EOF;
return 0;
}
private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, $autoloadType = null, array $classMap, array &$ambiguousClasses)
private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses)
{
foreach ($this->generateClassMap($dir, $blacklist, $namespaceFilter, $autoloadType) as $class => $path) {
$pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n";

View File

@ -323,7 +323,7 @@ class Installer
1 === $fundingCount ? '' : 's',
1 === $fundingCount ? 'is' : 'are'
),
'<info>Use the composer fund command to find out more!</info>',
'<info>Use the `composer fund` command to find out more!</info>',
));
}

View File

@ -134,6 +134,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');
}

View File

@ -429,6 +429,29 @@ class GitLabDriver extends VcsDriver
if ($fetchingRepoData) {
$json = $response->decodeJson();
// Accessing the API with a token with Guest (10) access will return
// more data than unauthenticated access but no default_branch data
// accessing files via the API will then also fail
if (!isset($json['default_branch']) && isset($json['permissions'])) {
$this->isPrivate = $json['visibility'] !== 'public';
$moreThanGuestAccess = false;
// Check both access levels (e.g. project, group)
// - value will be null if no access is set
// - value will be array with key access_level if set
foreach ($json['permissions'] as $permission) {
if ($permission && $permission['access_level'] > 10) {
$moreThanGuestAccess = true;
}
}
if (!$moreThanGuestAccess) {
$this->io->writeError('<warning>GitLab token with Guest only access detected</warning>');
return $this->attemptCloneFallback();
}
}
// force auth as the unauthenticated version of the API is broken
if (!isset($json['default_branch'])) {
if (!empty($json['id'])) {

View File

@ -53,7 +53,7 @@ Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
Generating autoload files
2 packages you are using are looking for funding.
Use the composer fund command to find out more!
Use the `composer fund` command to find out more!
--EXPECT--
Installing b/b (1.0.0)
Installing d/d (1.0.0)