Hi there! Some time ago I looked for a way to synchronize local public file system with production site without direct access to it with ssh or ftp. I didn't know about this awesome module so I made a drush command to fix the issue. It doesn't duplicate drush rsync because it transfers files through http as this module does. I think we could add drush support to the module.

Comments

chi’s picture

Issue summary: View changes
greggles’s picture

Status: Active » Needs review
greggles’s picture

I just reviewed this and its an interesting idea. One of the theories of this module is that it's a proxy and only downloads things as they are needed.

That said, I could see the benefit of the solution you provided in a few scenarios.

Anyone else have opinions on this proposal?

pere orga’s picture

I think that would be a great addition

jelle_s’s picture

I wrote a similar script that can be used after configuring the module. Just 5 lines of PHP (just for other people who might be looking for this):

foreach (db_select('file_managed', 'f')->fields('f', array('uri'))->execute()->fetchCol() as $uri) {
  if(!file_exists($uri)) {
    drupal_http_request(file_create_url($uri));
  }
}

Note that depending on how many files there are this might take quite a while, and it might be (or will be) better to convert it to a drupal batch operation or something similar.

sylvainm’s picture

I think it is a good idea and wrote also on my side this drush command : see attached file.

asrob’s picture

Status: Needs review » Reviewed & tested by the community

I've tested SylvainM's patch and it seems to me that will be good. There were some files that couldn't be downloaded but I think it's site/server issue because I couldn't find those files.

greggles’s picture

@asrob, there are two proposals here: 1 is in a zip and 1 in a patch. Any chance you could review them both and compare/contrast?

BarisW’s picture

I reviewed both proposals; the patch is created for stage_file_proy while the zip is a more generic approach.
I renamed the drush command to stage-file-proxy-dl instead of stage-file-proxy-download-all, since the drush command overview truncated the latter to stage-file-proxy-dow.

BarisW’s picture

  • BarisW committed 836bd28 on 7.x-1.x authored by SylvainM
    Issue #2136691 by SylvainM, Chi, greggles, Jelle_S, asrob, BarisW: Drush...
BarisW’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to 7.x-1.x-dev. If someone would port this to D8, that would be awesome!

  • BarisW committed 9f69e07 on 7.x-1.x
    Rename drush function. Refs #2136691
    
sylvainm’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new3.14 KB

Here is a D8 patch

  • BarisW committed cc65c56 on 7.x-1.x
    Fix PHP5 fatal error in drush function. Refs #2136691.
    
BarisW’s picture

Status: Needs review » Reviewed & tested by the community

Tested the patch, it works great. Thanks for porting it SylvainM!

  • BarisW committed 9187a82 on 8.x-1.x authored by SylvainM
    Issue #2136691 by SylvainM, BarisW: Drush integration for D8
    
BarisW’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.