6.0.0-git
2019-04-21

[#8323] Use streams for ssh2 driver in VFS
Summary Use streams for ssh2 driver in VFS
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners chuck (at) horde (dot) org
Requester jives (at) jives (dot) ixum (dot) net
Created 2009-06-04 (3608 days ago)
Due
Updated 2009-06-15 (3597 days ago)
Assigned 2009-06-06 (3606 days ago)
Resolved 2009-06-15 (3597 days ago)
Milestone 3.3.5
Patch Yes

History
2009-06-15 14:20:22 Chuck Hagenbuch Comment #6
Assigned to Chuck Hagenbuch
Taken from Horde DevelopersHorde Developers
State ⇒ Resolved
Reply to this comment
Committed to HEAD and 3.3.5 - thanks!
2009-06-06 23:01:08 Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
Milestone ⇒ 3.3.5
Patch ⇒ Yes
 
2009-06-06 23:00:16 Jan Schneider Deleted Original Message
 
2009-06-06 17:13:50 jives (at) jives (dot) ixum (dot) net Comment #4
New Attachment: ssh2.php.patch Download
Reply to this comment
If you are already using streams, why do you read the complete file
contents into memory instead of using copy()? You could even replace
VFS' copy and move functionality completely by the native PHP calls.
Also, please review your patch reading the Horde coding standards
(single quotes, lowercase keywords). And if you want the patch to
also be applied to the stable branch, you need a fallback if
file_put_contents() doesn't exist (PHP 5 only).
You are obviously right - there is no need to read the file into 
memory. As for the replacement of the VFS functions: I don't know if 
using the native PHP functions is better or worse in terms of 
compatibility and performance. Because of that and since the 
ssh2_sftp_*-functions which are used for copying and moving files seem 
to work on any system (in contrast to the ssh2_scp_*-functions), I 
didn't touch them.

I also tried to adapt my code to comply with the Horde coding standards.
2009-06-05 07:19:56 Jan Schneider Comment #3
Summary ⇒ Use streams for ssh2 driver in VFS
State ⇒ Feedback
Reply to this comment
If you are already using streams, why do you read the complete file 
contents into memory instead of using copy()? You could even replace 
VFS' copy and move functionality completely by the native PHP calls.

Also, please review your patch reading the Horde coding standards 
(single quotes, lowercase keywords). And if you want the patch to also 
be applied to the stable branch, you need a fallback if 
file_put_contents() doesn't exist (PHP 5 only).
2009-06-05 07:13:49 Jan Schneider Type ⇒ Enhancement
Version ⇒ HEAD
Queue ⇒ Horde Framework Packages
State ⇒ New
Priority ⇒ 1. Low
 
2009-06-05 02:56:21 Chuck Hagenbuch Deleted Original Message
 
2009-06-04 22:21:19 jives (at) jives (dot) ixum (dot) net Comment #2
New Attachment: ssh2.php[1].diff
Reply to this comment
Sorry, posted the wrong diff. Here's the right one.
2009-06-04 21:21:20 jives (at) jives (dot) ixum (dot) net Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Down- and upload over SSH2 partially broken
Queue ⇒ Gollem
Milestone ⇒
Patch ⇒ Yes
New Attachment: ssh2.php.diff
Reply to this comment
I hope I'm posting this in the right queue.



It looks like the ssh2_scp_* php functions do not work on some 
systems. See http://phpbuilder.com/board/showthread.php?t=10352595 and 
http://forums.devnetwork.net/viewtopic.php?t=80343 for that matter. My 
system is one of those - everything (!) except uploading and 
downloading/editing files with Gollem over the SSH2 backend works.



However, there is a workaround using the php fopen wrappers. I wrote a 
quick and dirty hack using this workaround - see the attached diff 
file for ssh2.php.

Saved Queries