Skip to content

Commit 89ed54f

Browse files
authored
Merge pull request #127 from php-etl/fix/composer-from-local
fix composer.from_local
2 parents 85404bf + cba0155 commit 89ed54f

File tree

7 files changed

+534
-600
lines changed

7 files changed

+534
-600
lines changed

composer.lock

Lines changed: 531 additions & 571 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Adapter/Composer.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,6 @@ public function autoload(array $autoloads): void
174174
file_put_contents($this->workdir.'/composer.json', json_encode($composer, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
175175
}
176176

177-
public function install(): void
178-
{
179-
$this->command(
180-
'composer',
181-
'install',
182-
'--prefer-dist',
183-
'--no-progress',
184-
'--prefer-stable',
185-
'--sort-packages',
186-
'--optimize-autoloader',
187-
'--no-dev',
188-
);
189-
}
190-
191177
public function addGithubRepository(string $name, string $url): void
192178
{
193179
$this->command(

src/Adapter/Docker/Factory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt
6060
} else {
6161
$builder->withComposerFile(new Packaging\Asset\LocalFile('composer.json'));
6262
}
63-
if (file_exists('vendor')) {
64-
$builder->withDirectory(new Packaging\Directory('vendor/'));
65-
}
6663
}
6764

6865
if (\array_key_exists('autoload', $configuration['composer']) && \array_key_exists('psr4', $configuration['composer']['autoload'])) {

src/Adapter/Docker/SatelliteBuilder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ public function build(): Configurator\SatelliteInterface
164164
}
165165

166166
$dockerfile->push(new Dockerfile\PHP\Composer());
167-
$dockerfile->push(new Dockerfile\PHP\ComposerInstall());
168167
} else {
169168
$dockerfile->push(new Dockerfile\PHP\Composer());
170169
$dockerfile->push(new Dockerfile\PHP\ComposerInit(sprintf('satellite/%s', substr(hash('sha512', random_bytes(64)), 0, 64))));

src/Adapter/Filesystem/Factory.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt
3030
if (\array_key_exists('from_local', $configuration['composer']) && true === $configuration['composer']['from_local']) {
3131
if (file_exists('composer.lock')) {
3232
$builder->withComposerFile(
33-
new Packaging\Asset\LocalFile('composer.json'),
34-
new Packaging\Asset\LocalFile('composer.lock'),
33+
new Packaging\File('composer.json', new Packaging\Asset\LocalFile('composer.json')),
34+
new Packaging\File('composer.lock', new Packaging\Asset\LocalFile('composer.lock')),
3535
);
3636
} else {
3737
$builder->withComposerFile(
38-
new Packaging\Asset\LocalFile('composer.json'),
38+
new Packaging\File('composer.json', new Packaging\Asset\LocalFile('composer.json')),
3939
);
4040
}
41-
if (file_exists('vendor')) {
42-
$builder->withDirectory(new Packaging\Directory('vendor/'));
43-
}
4441
}
4542

4643
if (\array_key_exists('autoload', $configuration['composer']) && \array_key_exists('psr4', $configuration['composer']['autoload'])) {

src/Adapter/Filesystem/SatelliteBuilder.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ public function build(): Configurator\SatelliteInterface
129129
if (null !== $this->composerLockFile) {
130130
$satellite->withFile($this->composerLockFile);
131131
}
132-
133-
$composer->install();
134132
} else {
135133
$composer->init(sprintf('satellite/%s', substr(hash('sha512', random_bytes(64)), 0, 64)));
136134
$composer->minimumStability('dev');

src/Adapter/Tar/Factory.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ public function __invoke(array $configuration): Configurator\SatelliteBuilderInt
3333
} else {
3434
$builder->withComposerFile(new Packaging\Asset\LocalFile('composer.json'));
3535
}
36-
if (file_exists('vendor')) {
37-
$builder->withDirectory(new Packaging\Directory('vendor/'));
38-
}
3936
}
4037

4138
if (\array_key_exists('autoload', $configuration['composer']) && \array_key_exists('psr4', $configuration['composer']['autoload'])) {

0 commit comments

Comments
 (0)