2

drush_download_file() existed in includes/drush.inc for Drush 8 and below, but this has been removed in Drush 9 as far as I can tell.

Is there a standard way that file downloads should be executed in custom commands written for Drush 9?

3

With Drush 9 dropping support for the drush dl command, the need for keeping a download function was dropped.

The remnants of drush_download_file() were dropped into the SyncViaHttpCommands.php example class to demonstrate creating a custom a Drush commandfile. You could copy that as a template if you're looking to mimic the old drush_download_file(), or you could use the Guzzle client or some other PHP function; use what works best for your command's download needs.

  • Nice find. Very insightful. Thank you. – JamesWilson Apr 25 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.