- Issue created by @webbywe
- πΊπΈUnited States jcandan
A patch rolled from #5 β¨ Allow a remote file to be specified for the Source path parameter Active .
- πΊπΈUnited States jcandan
Taking inspiration from patch #15 β of β¨ Import data from URL Closed: won't fix , with a fix to for the removal of file_save_data() β , it may be simpler to replace all the
curl
bits to go with something like:// Retrieve data from URL. $data = file_get_contents($remote_path); if ($data === FALSE) { throw new \RuntimeException("Unable to retrieve data from '{$remote_path}'."); } // Save data to temporary dir. $path = "temporary://" . basename($remote_path); $file = \Drupal::service('file.repository')->writeData($data, $path); if ($file === FALSE) { throw new \RuntimeException("Unable to save file to '{$path}'."); } return $file->getFileUri();
- πΊπΈUnited States jcandan
jcandan β changed the visibility of the branch 3469594-allow-a-remote to hidden.
- Status changed to Postponed: needs info
12 days ago 3:36pm 27 December 2024 - heddn Nicaragua
We have Guzzle available to us so the curl isn't really needed.
Also, I'm not sure I like the idea of having remote resources download-able by default with this module. That opens up the attack surface quite a bit. Being able to do any prep work for a resource could/should happen before the migration happens. Say via a shell script that curl/downloads the resources locally first. Convince me why this is strictly necessary.