1
0
Fork 0

Merge branch '2.2' into main

pull/10449/head
Jordi Boggiano 2022-01-07 09:30:43 +01:00
commit f1568f1f8f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
5 changed files with 15 additions and 12 deletions

View File

@ -65,6 +65,12 @@ if (function_exists('ini_set')) {
unset($memoryLimit); unset($memoryLimit);
} }
// Workaround PHP bug on Windows where env vars containing Unicode chars are mangled in $_SERVER
// see https://github.com/php/php-src/issues/7896
if (Platform::isWindows()) {
$_SERVER = array_merge($_SERVER, array_intersect_ukey($_SERVER, getenv(), 'strcasecmp'));
}
Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0])); Platform::putEnv('COMPOSER_BINARY', realpath($_SERVER['argv'][0]));
ErrorHandler::register(); ErrorHandler::register();

View File

@ -340,7 +340,7 @@ class Application extends BaseApplication
return $result; return $result;
} catch (ScriptExecutionException $e) { } catch (ScriptExecutionException $e) {
return (int) $e->getCode(); return $e->getCode();
} catch (\Exception $e) { } catch (\Exception $e) {
$ghe = new GithubActionError($this->io); $ghe = new GithubActionError($this->io);
$ghe->emit($e->getMessage()); $ghe->emit($e->getMessage());

View File

@ -39,14 +39,6 @@ class SolverProblemsException extends \RuntimeException
parent::__construct('Failed resolving dependencies with '.count($problems).' problems, call getPrettyString to get formatted details', self::ERROR_DEPENDENCY_RESOLUTION_FAILED); parent::__construct('Failed resolving dependencies with '.count($problems).' problems, call getPrettyString to get formatted details', self::ERROR_DEPENDENCY_RESOLUTION_FAILED);
} }
/**
* @return self::ERROR_DEPENDENCY_RESOLUTION_FAILED
*/
public function getExitCode()
{
return self::ERROR_DEPENDENCY_RESOLUTION_FAILED;
}
/** /**
* @param bool $isVerbose * @param bool $isVerbose
* @param bool $isDevExtraction * @param bool $isDevExtraction

View File

@ -455,7 +455,7 @@ class Installer
$ghe = new GithubActionError($this->io); $ghe = new GithubActionError($this->io);
$ghe->emit($err."\n".$prettyProblem); $ghe->emit($err."\n".$prettyProblem);
return max(self::ERROR_GENERIC_FAILURE, $e->getExitCode()); return max(self::ERROR_GENERIC_FAILURE, $e->getCode());
} }
$this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE); $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE);
@ -633,7 +633,7 @@ class Installer
$ghe = new GithubActionError($this->io); $ghe = new GithubActionError($this->io);
$ghe->emit($err."\n".$prettyProblem); $ghe->emit($err."\n".$prettyProblem);
return max(self::ERROR_GENERIC_FAILURE, $e->getExitCode()); return $e->getCode();
} }
$lockTransaction->setNonDevPackages($nonDevLockTransaction); $lockTransaction->setNonDevPackages($nonDevLockTransaction);
@ -703,7 +703,7 @@ class Installer
$ghe = new GithubActionError($this->io); $ghe = new GithubActionError($this->io);
$ghe->emit($err."\n".$prettyProblem); $ghe->emit($err."\n".$prettyProblem);
return max(self::ERROR_GENERIC_FAILURE, $e->getExitCode()); return max(self::ERROR_GENERIC_FAILURE, $e->getCode());
} }
} }

View File

@ -504,6 +504,11 @@ class GitLabDriver extends VcsDriver
// force auth as the unauthenticated version of the API is broken // force auth as the unauthenticated version of the API is broken
if (!isset($json['default_branch'])) { if (!isset($json['default_branch'])) {
// GitLab allows you to disable the repository inside a project to use a project only for issues and wiki
if (isset($json['repository_access_level']) && $json['repository_access_level'] === 'disabled') {
throw new TransportException('The GitLab repository is disabled in the project', 400);
}
if (!empty($json['id'])) { if (!empty($json['id'])) {
$this->isPrivate = false; $this->isPrivate = false;
} }