6.0.0-alpha14
7/3/25

[#8657] Cyclic Dependency in ssh2.php
Summary Cyclic Dependency in ssh2.php
Queue Horde Base
Queue Version 3.3.5
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester rene.plattner (at) uibk (dot) ac (dot) at
Created 10/22/2009 (5733 days ago)
Due
Updated 11/11/2009 (5713 days ago)
Assigned
Resolved 10/22/2009 (5733 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/11/2009 10:00:56 AM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #11 Reply to this comment
Dear Horde Team!

I tested it and i have problems to read and write with the native copy 
function from php.
I use centos 5 with php version 5.1.6

kind regards
10/28/2009 12:49:07 PM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #10 Reply to this comment
Sorry my fault!
This is the native copy methode from php.
I will test it again and report my results!

Sorry!

Kind regards,
It's not possible to send or receive any file with the copy function.

There are no error messages in the php log nor in the horde log.
10/28/2009 08:49:06 AM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #9 Reply to this comment
Sorry my fault!

This is the native copy methode from php.

I will test it again and report my results!



Sorry!



Kind regards,
10/28/2009 08:46:27 AM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #8 Reply to this comment
This ticket added the new code: http://bugs.horde.org/ticket/8323



You changed the native ssh2 scp functions with _recv and _send!

They use a copy methode with two arguments (source and destination).

But you have implemented a copy methode with three arguments (path, 
name and destination).



Why this action?
10/28/2009 08:37:49 AM Jan Schneider Comment #7 Reply to this comment
Please stop teaching us how PHP works!

http://www.php.net/copy
10/28/2009 08:28:11 AM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #6 Reply to this comment
Are you reading ruby instead of PHP? @ silences errors in PHP, it
doesn't call a class method.
Joke?



From lib/VFS/ssh2.php:



Look at these functions:



     /**

      * Sends local file to remote host.

      * This function exists because the php_scp_* functions doesn't 
seem to work on some hosts.

      *

      * @access private

      *

      * @param string $local   Full path to the local file.

      * @param string $remote  Full path to the remote location.

      *

      * @return boolean TRUE on success, FALSE on failure.

      */

     function _send($local, $remote)

     {

         return copy($local, $this->_wrap($remote));

     }



     /**

      * Receives file from remote host.

      * This function exists because the php_scp_* functions doesn't 
seem to work on some hosts.

      *

      * @access private

      *

      * @param string $local  Full path to the local file.

      * @param string $remote Full path to the remote location.

      *

      * @return boolean TRUE on success, FALSE on failure.

      */

     function _recv($remote, $local)

     {

         return copy($this->_wrap($remote), $local);

     }



Which copy methode is here called?



Kind regards!
10/27/2009 11:23:42 PM Chuck Hagenbuch Comment #5 Reply to this comment
Are you reading ruby instead of PHP? @ silences errors in PHP, it 
doesn't call a class method.
10/27/2009 12:26:04 PM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #4 Reply to this comment
_recv() and _send() use copy(), not $this->copy().
The copy function from VFS.php uses read and writeData from ssh2.php, 
but read and writeData uses _recv and _send! Cyclic Dependency!


10/22/2009 05:46:30 PM Jan Schneider Comment #3
Priority ⇒ 1. Low
State ⇒ Not A Bug
Reply to this comment
_recv() and _send() use copy(), not $this->copy().
10/22/2009 02:49:49 PM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #2
New Attachment: ssh2_diff.php Download
Reply to this comment
The copy function should not use _send and _recv functions because
both (_send and _recv) depend on copy!!!

In _recv and _send the native code is necessary!
10/22/2009 01:20:06 PM rene (dot) plattner (at) uibk (dot) ac (dot) at Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Cyclic Dependency in ssh2.php
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
The copy function should not use _send and _recv functions because 
both (_send and _recv) depend on copy!!!



In _recv and _send the native code is necessary!

Saved Queries