Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add download-only mode #11041

Merged
merged 6 commits into from
Oct 12, 2022
Merged

Add download-only mode #11041

merged 6 commits into from
Oct 12, 2022

Conversation

Jellyfrog
Copy link
Contributor

Fixes #11035

@Jellyfrog
Copy link
Contributor Author

One thing left to consider fixing is this leaves the vendor/composer/tmp-* files.

@Seldaek Seldaek added this to the 2.5 milestone Sep 1, 2022
@Seldaek Seldaek added the Feature label Sep 1, 2022
@Jellyfrog
Copy link
Contributor Author

It now cleans the tmp files.
Another possible solution would be to add a new operation type, then we don't need to pass the $downloadOnly-variable.

@Jellyfrog Jellyfrog marked this pull request as ready for review October 9, 2022 14:28
Comment on lines 264 to 266
$this->runScripts = false;
$this->writeLock = false;
$this->dumpAutoloader = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure about thse..

Removing autoload dumping sure, makes sense.

Disabling scripts I think that is a mistake as plugins and whatever might depend on those scripts to do the downloading correctly.

And writeLock I think I would leave it on, as if you do an update with download only (not possible via CLI, but possible if you do this programmatically) it should still persist the update result to the lock file IMO.

Comment on lines 375 to 378
if ($downloadOnly) {
$this->download($package);
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a gut feeling this isn't the best way to bypass the operations here.. But I gotta try it myself, if I can improve I'll add a commit to your branch.

@Seldaek Seldaek merged commit 8ed7c46 into composer:main Oct 12, 2022
@Seldaek
Copy link
Member

Seldaek commented Oct 12, 2022

Thanks!

emahorvat52 pushed a commit to emahorvat52/composer that referenced this pull request Feb 3, 2023
composer install --download-only to prime the cache/download archives but not do any actual of the actual installing

Fixes composer#11035

Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download-only mode
2 participants