Merge branch '2.5'
commit
fe741e0ffe
|
@ -369,6 +369,7 @@ TAGSPUBKEY
|
||||||
$io->write('Open <info>https://composer.github.io/pubkeys.html</info> to find the latest keys');
|
$io->write('Open <info>https://composer.github.io/pubkeys.html</info> to find the latest keys');
|
||||||
|
|
||||||
$validator = static function ($value): string {
|
$validator = static function ($value): string {
|
||||||
|
$value = (string) $value;
|
||||||
if (!Preg::isMatch('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) {
|
if (!Preg::isMatch('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) {
|
||||||
throw new \UnexpectedValueException('Invalid input');
|
throw new \UnexpectedValueException('Invalid input');
|
||||||
}
|
}
|
||||||
|
@ -379,7 +380,7 @@ TAGSPUBKEY
|
||||||
$devKey = '';
|
$devKey = '';
|
||||||
while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) {
|
while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) {
|
||||||
$devKey = $io->askAndValidate('Enter Dev / Snapshot Public Key (including lines with -----): ', $validator);
|
$devKey = $io->askAndValidate('Enter Dev / Snapshot Public Key (including lines with -----): ', $validator);
|
||||||
while ($line = $io->ask('')) {
|
while ($line = $io->ask('', '')) {
|
||||||
$devKey .= trim($line)."\n";
|
$devKey .= trim($line)."\n";
|
||||||
if (trim($line) === '-----END PUBLIC KEY-----') {
|
if (trim($line) === '-----END PUBLIC KEY-----') {
|
||||||
break;
|
break;
|
||||||
|
@ -392,7 +393,7 @@ TAGSPUBKEY
|
||||||
$tagsKey = '';
|
$tagsKey = '';
|
||||||
while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) {
|
while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) {
|
||||||
$tagsKey = $io->askAndValidate('Enter Tags Public Key (including lines with -----): ', $validator);
|
$tagsKey = $io->askAndValidate('Enter Tags Public Key (including lines with -----): ', $validator);
|
||||||
while ($line = $io->ask('')) {
|
while ($line = $io->ask('', '')) {
|
||||||
$tagsKey .= trim($line)."\n";
|
$tagsKey .= trim($line)."\n";
|
||||||
if (trim($line) === '-----END PUBLIC KEY-----') {
|
if (trim($line) === '-----END PUBLIC KEY-----') {
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -163,9 +163,13 @@ class FilesystemRepository extends WritableArrayRepository
|
||||||
|
|
||||||
$this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', '<?php return ' . $this->dumpToPhpCode($versions) . ';'."\n");
|
$this->filesystem->filePutContentsIfModified($repoDir.'/installed.php', '<?php return ' . $this->dumpToPhpCode($versions) . ';'."\n");
|
||||||
$installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php');
|
$installedVersionsClass = file_get_contents(__DIR__.'/../InstalledVersions.php');
|
||||||
$this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass);
|
|
||||||
|
|
||||||
\Composer\InstalledVersions::reload($versions);
|
// this normally should not happen but during upgrades of Composer when it is installed in the project it is a possibility
|
||||||
|
if ($installedVersionsClass !== false) {
|
||||||
|
$this->filesystem->filePutContentsIfModified($repoDir.'/InstalledVersions.php', $installedVersionsClass);
|
||||||
|
|
||||||
|
\Composer\InstalledVersions::reload($versions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue