copy(): Copy files or folders from a container to a tar stream. copyToDi... - #109
copy(): Copy files or folders from a container to a tar stream. copyToDi...#109Boran wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
We need to handle errors like 'permission denied' or 'file not found' (in case directory not exists). I suggest not to use fopen, it throws uncatchable warning in case of opening error.
Quick and dirty solution - mute fopen with @ and then check $output is not null.
Better solution - open file by SPL SplFileObject in try-catch block.
|
Apparently Spl is in php 5.x, so just tried: |
|
Hey Sean, |
|
Oops :-) |
|
Using fopen rather than SplFileObject due to stream_copy_to_stream() |
|
Hi, can this be committed please? |
There was a problem hiding this comment.
Could you just add an empty line before that if?
|
And sorry for being a coding style nazi |
|
Hey @Boran, sorry for the delay. Before this can be merged, indentation and CS needs to be fixed:
|
|
I've been waiting 6 months to get this small patch integrated, hardly motivating.. |
|
The failing test is not related to this PR. Looks good to me 👍 |
You are right, and I should have handled your PR earlier and in a more swift manner. That being said, there still are inconsistencies in your PR regarding to CS, and you merged master in your branch instead of rebasing your branch on master, which screws up the history. Anyway, I made a new PR based on your commits, fixed the CS, then rebased against master and squashed the commits in #128 |
|
Oops, apologies for that I had forgotten the correct procedure. Thanks for sorting it out:) Sean Boran
|
|
No problem. Just merged #128 |
After over an hour trying to rebase and solve merge conflicts on #89 I'm giving up on that branch and create this new one 'file-copy2'. All changes are in one commit.