Repository navigation
new SMB storage backend - #4770
icewind1991 wants to merge 28 commits into
Conversation
|
Test failed. |
|
Test passed. |
There was a problem hiding this comment.
hmm - smb/cifs shares can be read only as well
|
@icewind1991 Regarding testRoot: for further testing: grab a windows vm here: http://www.modern.ie/en-US/virtualization-tools#downloads |
|
Test passed. |
|
@icewind1991 Did you keep in mind the issue #2502 when implementing the new SMB storage backend? |
|
OC7 |
|
@icewind1991 I haven't read the code yet. Will it support streaming ? (ie not having to download a whole file when only the first MB is needed, for example for thumbnail generation or mimetype detection) |
|
No, that is a limitation of smbclient itself |
|
Would be good to check whether it's possible to tell smbclient to output the file contents to stdout instead of a target file (or pipe it). If that works, it might be possible to stream whatever comes from its stdout back to ownCloud, maybe using popen() and pipes. |
|
Awwwyeah, streaming/piping could work, this worked for me: Seems it can work with put as well: |
There was a problem hiding this comment.
This needs to either use file_exists() or fallback to the default impl that does just that.
Same for isUpdatable().
Always returning true might make callers believe that a file exists when it doesn't (scanFile())
Conflicts: apps/files_external/3rdparty/smb4php/smb.php apps/files_external/lib/smb.php
…rename not overwriting
|
Updated streamwrapper and storage. tested against a windows 8 VM and a samba server on Arch Linux. |
|
A new inspection was created. |
|
🚀 Test Passed. 🚀 |
There was a problem hiding this comment.
Can't this be done in a more automatic-autoload-approach, i.e. without registering your own autoloader?
|
Please add class documentation to all classes. E.g. it should be easily possible to see what the difference between RawConnection and Connection is. |
There was a problem hiding this comment.
Shouldn't these be available to subclasses? Personally, I think that the number of proper use-cases of private is just as limited as the number of use-cases for static.
|
A PHP Stream Wrapper for SMB would be pretty awesome. :-) |
|
@icewind1991 I started testing this, see some failing results here #4770 (comment) |
|
I'd say better rebase this first, it seems some issues might be caused by stuff that was fixed already on master. |
|
A new inspection was created. |
|
Do we really want to continue with the approach to fork smbclient processes? Even with a much better looking code base the basic mechanism remains - I'd prefer to have a native php module which uses samba libs to talk to smb/cifs shares directly. |
|
@DeepDiver1975 I think improving the existing approach using smbclient via exec is an acceptable intermediate step. |
|
One advantage I saw here is that the smbclient process is only started once, and its internal CLI is driven by @icewind1991 's code which should improve performance a bit as we don't need to restart the process for every command (stat, etc...) I'm still a bit afraid that this big change causes regressions. |
|
I agree that having a native php module would be the optimal solution but that wont be available in all situations |
|
🚀 Test Passed. 🚀 |
true - but installations not capable of installing a custom/self-built php module generally don't need access to smb shares |
|
superseded by #10673 |
New implementation of the SMB storage backend using a new wrapper for smbclient (https://github.com/icewind1991/SMB).
This improves the test-ability and maintainability of the SMB backend and hopefully helps with the various issues the current SMB backend has.
Tested it locally against an smb server running on arch, requires testing against a windows smb server.
cc @DeepDiver1975 @karlitschek