I was in the unlucky situation to be offline when I ran Drush 4 for the first time. Got the message 'Drush needs a copy of the PEAR Console_Table library ...' but when online Drush did not recover from this situation. This was caused by an empty /includes/table.inc file created by wget, which creates an empty file when exiting with a time out (OSX 10.6.6 if that matters).
| Comment | File | Size | Author |
|---|---|---|---|
| drush-recover-from-wget.patch | 926 bytes | sutharsan |
Comments
Comment #1
greg.1.anderson commentedCould not reproduce. For me, this code does the trick:
Why is it that wget/curl might sometimes work if file_get_contents does not?
I'm not saying that I don't believe the OP, I'm just confused about why that code branch is there at all. Rather than the patch in #0, I would just replace the two occurrences of
if (!file_exists($tablefile)) {withif (!drush_file_not_empty($tablefile)) {. I'd commit it if I knew why it was needed at all.Anyway, seems fine; maybe someone else can confirm and commit.
Comment #2
kotnik commentedOne thing is sure, wget indeed does create empty file after it fails to download it:
There's no reason not to apply this patch.
Comment #3
moshe weitzman commentedcommitted. thanks.