Skip to content

Commit 91db60a

Browse files
committed
bug #577 Relax PHP version constraint - dont lock when run from globals (nicolas-grekas)
This PR was merged into the 1.5-dev branch. Discussion ---------- Relax PHP version constraint - dont lock when run from globals Commits ------- 446ea94 Relax PHP version constraint - dont lock when run from globals
2 parents 97d4d94 + 446ea94 commit 91db60a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Flex.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ public function configureInstaller()
270270

271271
public function lockPlatform()
272272
{
273+
if (!$this->downloader->isEnabled()) {
274+
return; // "symfony/flex" not found in the root composer.json - don't create the symfony.lock file
275+
}
276+
273277
$this->lock->set('php', [
274278
'version' => $this->config->get('platform')['php'] ?? (PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION),
275279
]);
@@ -678,7 +682,7 @@ private function updateAutoloadFile()
678682
}
679683

680684
$platform = preg_replace('/[^-+.~_\w]/', '', $platform);
681-
$version = sprintf('%d%02d%02d', ...explode('.', $platform.'.0.0'));
685+
$version = sprintf('%d%02d00', ...explode('.', $platform.'.0'));
682686

683687
file_put_contents($autoloadFile, <<<EOPHP
684688
<?php

0 commit comments

Comments
 (0)