Net_SFTP
[ class tree: Net_SFTP ] [ index: Net_SFTP ] [ all elements ]

Class: Net_SFTP

Source Location: /lib/3rdParty/phpseclib/Net/SFTP.php

Class Overview

Net_SSH2
   |
   --Net_SFTP

Pure-PHP implementations of SFTP.


Author(s):

Version:

  • 0.1.0

Methods


Inherited Methods

Class: Net_SSH2

Net_SSH2::Net_SSH2()
Default Constructor.
Net_SSH2::disconnect()
Disconnect
Net_SSH2::exec()
Execute Command
Net_SSH2::getCompressionAlgorithmsClient2Server()
Return a list of the compression algorithms the server supports, when receiving stuff from the client.
Net_SSH2::getCompressionAlgorithmsServer2Client()
Return a list of the compression algorithms the server supports, when sending stuff to the client.
Net_SSH2::getEncryptionAlgorithmsClient2Server()
Return a list of the (symmetric key) encryption algorithms the server supports, when receiving stuff from the client.
Net_SSH2::getEncryptionAlgorithmsServer2Client()
Return a list of the (symmetric key) encryption algorithms the server supports, when sending stuff to the client.
Net_SSH2::getErrors()
Returns all errors
Net_SSH2::getKexAlgorithms()
Return a list of the key exchange algorithms the server supports.
Net_SSH2::getLanguagesClient2Server()
Return a list of the languages the server supports, when receiving stuff from the client.
Net_SSH2::getLanguagesServer2Client()
Return a list of the languages the server supports, when sending stuff to the client.
Net_SSH2::getLastError()
Returns the last error
Net_SSH2::getLog()
Returns a log of the packets that have been sent and received.
Net_SSH2::getMACAlgorithmsClient2Server()
Return a list of the MAC algorithms the server supports, when receiving stuff from the client.
Net_SSH2::getMACAlgorithmsServer2Client()
Return a list of the MAC algorithms the server supports, when sending stuff to the client.
Net_SSH2::getServerHostKeyAlgorithms()
Return a list of the host key (public key) algorithms the server supports.
Net_SSH2::getServerIdentification()
Return the server identification.
Net_SSH2::getServerPublicHostKey()
Returns the server public host key.
Net_SSH2::login()
Login
Net_SSH2::__destruct()
Destructor.

Class Details

[line 107]
Pure-PHP implementations of SFTP.



Tags:

author:  Jim Wigginton <terrafrost@php.net>
version:  0.1.0
access:  public


[ Top ]


Class Methods


constructor Net_SFTP [line 226]

Net_SFTP Net_SFTP( String $host, [optional $port = 22], [optional $timeout = 10])

Default Constructor.

Connects to an SFTP server




Tags:

access:  public


Parameters:

String   $host  
optional   $port   Integer $port
optional   $timeout   Integer $timeout

[ Top ]

method chdir [line 517]

Boolean chdir( String $dir)

Changes the current directory



Tags:

access:  public


Parameters:

String   $dir  

[ Top ]

method chmod [line 742]

Mixed chmod( Integer $mode, String $filename)

Set permissions on a file.

Returns the new file permissions on success or FALSE on error.




Tags:

access:  public


Parameters:

Integer   $mode  
String   $filename  

[ Top ]

method delete [line 1161]

Boolean delete( String $path)

Deletes a file on the SFTP server.



Tags:

access:  public


Parameters:

String   $path  

[ Top ]

method get [line 1043]

Mixed get( String $remote_file, [optional $local_file = false])

Downloads a file from the SFTP server.

Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the operation




Tags:

access:  public


Parameters:

String   $remote_file  
optional   $local_file   String $local_file

[ Top ]

method getLastSFTPError [line 1429]

String getLastSFTPError( )

Returns the last error



Tags:

access:  public


[ Top ]

method getSFTPErrors [line 1418]

String getSFTPErrors( )

Returns all errors



Tags:

access:  public


[ Top ]

method getSFTPLog [line 1396]

String getSFTPLog( )

Returns a log of the packets that have been sent and received.

Returns a string if NET_SFTP_LOGGING == NET_SFTP_LOG_COMPLEX, an array if NET_SFTP_LOGGING == NET_SFTP_LOG_SIMPLE and false if !defined('NET_SFTP_LOGGING')




Tags:

return:  or Array
access:  public


[ Top ]

method getSupportedVersions [line 1440]

Array getSupportedVersions( )

Get supported SFTP versions



Tags:

access:  public


[ Top ]

method login [line 309]

Boolean login( String $username, [optional $password = ''])

Login



Tags:

access:  public


Overrides Net_SSH2::login() (Login)

Parameters:

String   $username  
optional   $password   String $password

[ Top ]

method mkdir [line 809]

Boolean mkdir( String $dir)

Creates a directory.



Tags:

access:  public


Parameters:

String   $dir  

[ Top ]

method nlist [line 576]

Mixed nlist( [optional $dir = '.'])

Returns a list of files in the given directory



Tags:

access:  public


Parameters:

optional   $dir   String $dir

[ Top ]

method put [line 902]

Boolean put( String $remote_file, String $data, [optional $mode = NET_SFTP_STRING])

Uploads a file to the SFTP server.

By default, Net_SFTP::put() does not read from the local filesystem. $data is dumped directly into $remote_file. So, for example, if you set $data to 'filename.ext' and then do Net_SFTP::get(), you will get a file, twelve bytes long, containing 'filename.ext' as its contents.

Setting $mode to NET_SFTP_LOCAL_FILE will change the above behavior. With NET_SFTP_LOCAL_FILE, $remote_file will contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how large $remote_file will be, as well.

Currently, only binary mode is supported. As such, if the line endings need to be adjusted, you will need to take care of that, yourself.




Tags:

access:  public


Parameters:

String   $remote_file  
String   $data  
optional   $mode   Integer $flags

[ Top ]

method pwd [line 420]

Mixed pwd( )

Returns the current directory name



Tags:

access:  public


[ Top ]

method rawlist [line 588]

Mixed rawlist( [optional $dir = '.'])

Returns a list of files in the given directory



Tags:

access:  public


Parameters:

optional   $dir   String $dir

[ Top ]

method rename [line 1202]

Boolean rename( String $oldname, String $newname)

Renames a file or a directory on the SFTP server



Tags:

access:  public


Parameters:

String   $oldname  
String   $newname  

[ Top ]

method rmdir [line 849]

Boolean rmdir( String $dir)

Removes a directory.



Tags:

access:  public


Parameters:

String   $dir  

[ Top ]

method size [line 700]

Mixed size( optional $filename)

Returns the file size, in bytes, or false, on failure

Files larger than 4GB will show up as being exactly 4GB.




Tags:

access:  public


Parameters:

optional   $filename   String $dir

[ Top ]

method _list [line 593]

void _list( $dir, [ $raw = true])



Parameters:

   $dir  
   $raw  

[ Top ]


Documentation generated on Thu, 28 Oct 2010 21:00:35 +0200 by phpDocumentor 1.4.1