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

Class: PhpFtp

Source Location: /PhpFtp.php

Class Overview




Variables

Constants

Methods



Class Details

[line 21]


[ Top ]


Class Variables

$_connection =

[line 74]

Connection resource



Tags:

access:  protected

Type:   resource


[ Top ]

$_options = array(
        self::OPT_TIMEOUT => 90,
        self::OPT_MODE => FTP_BINARY,
        self::OPT_HOST => null,
        self::OPT_PORT => 21,
        self::OPT_USERNAME => null,
        self::OPT_PASSWORD => null,
        self::OPT_SSL => false,
        self::OPT_PASV => null,
        self::OPT_USE_TMP_FILE => false,
        self::OPT_TMP_FILE_EXTENSION => '.tmp',
        self::OPT_OVERWRITE => false,
        self::OPT_REMOVE_UPLOADED => false,
        self::OPT_LOG_METHOD => null,
        self::OPT_RESUME => false,
        self::OPT_RETRY_ENABLE => false,
        self::OPT_RETRY_COUNT => 3,
        self::OPT_RETRY_SLEEP => 1
    )

[line 49]

Options



Tags:

access:  protected

Type:   array


[ Top ]

$_remoteDirectory =  '/'

[line 81]

Remote directory



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 88]

PhpFtp __construct( [ $options = array()])

Constructor



Tags:

access:  public


Parameters:

array   $options   Options to set

[ Top ]

method cdUp [line 239]

boolean cdUp( )

Move one directory up



Tags:

throws:  PhpFtp_Exception
access:  public


[ Top ]

method chdir [line 684]

boolean chdir( string $remoteDirectory)

Change remote directory



Tags:

access:  public


Parameters:

string   $remoteDirectory   Remote directory

[ Top ]

method chmod [line 1151]

boolean chmod( string $path, integer $mode)

Change permissions



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $path   Remote path
integer   $mode   Mode to set

[ Top ]

method close [line 279]

void close( )

Close ftp connection



Tags:

throws:  PhpFtp_Exception
access:  public


[ Top ]

method connect [line 128]

void connect( )

Connect to ftp server



Tags:

throws:  PhpFtp_Exception
access:  public


[ Top ]

method createRemoteDirectory [line 1012]

boolean createRemoteDirectory( string $remoteDirectory)

Create a remote directory if it doesn't exist



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remoteDirectory   Remote directory

[ Top ]

method deleteDirectory [line 909]

boolean deleteDirectory( string $remoteDirectory)

Delete an empty remote directory - full file path can be given



Tags:

access:  public


Parameters:

string   $remoteDirectory   Remote directory

[ Top ]

method deleteFile [line 886]

boolean deleteFile( string $remoteFile)

Delete a remote file - full file path can be given



Tags:

access:  public


Parameters:

string   $remoteFile   Remote file

[ Top ]

method deletePath [line 937]

boolean deletePath( string $remotePath)

Delete a path on the server



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remotePath   Remote path

[ Top ]

method directoryExists [line 862]

boolean directoryExists( string $remoteDirectory)

Check if a file exists on the server in the current remote directory



Tags:

access:  public


Parameters:

string   $remoteDirectory   Remote directory path

[ Top ]

method downloadDirectory [line 580]

boolean downloadDirectory( string $localDirectory, string $remoteDirectory, [ $contextualOptions = array()])

Download directory



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $localDirectory   Local directory
string   $remoteDirectory   Remote directory
array   $contextualOptions   Contextual options

[ Top ]

method downloadFile [line 482]

boolean downloadFile( string $localFile, string $remoteFile, [ $contextualOptions = array()])

Download a file



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $localFile   Local file path
string   $remoteFile   Remote file path
array   $contextualOptions   Contextual options

[ Top ]

method downloadList [line 651]

boolean downloadList( $filesList, string $localDirectory, [ $contextualOptions = array()])

Download list of files/directories



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

array   $filesList   List of files and/or directories
string   $localDirectory   Local directory
array   $contextualOptions   Contextual options

[ Top ]

method exec [line 1175]

mixed exec( string $command)

Execute arbitrary command



Tags:

access:  public


Parameters:

string   $command   Command to execute

[ Top ]

method fileExists [line 802]

boolean fileExists( string $remoteFileName)

Check if a file exists on the server in the current remote directory



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remoteFileName   Remote file name

[ Top ]

method getConnection [line 181]

resource getConnection( )

Get the FTP connection



Tags:

access:  public


[ Top ]

method getFileSize [line 826]

integer|false getFileSize( string $remoteFileName)

Get file size



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remoteFileName   Remote file name

[ Top ]

method getFilesList [line 1082]

array getFilesList( string $remoteDirectory)

Get files list



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remoteDirectory   Remote directory

[ Top ]

method getLastModified [line 845]

integer|false getLastModified( string $remoteFileName)

Get last modified timestamp



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remoteFileName   Remote file name

[ Top ]

method getPwd [line 302]

string getPwd( )

Get current directory name



Tags:

throws:  PhpFtp_Exception
access:  public


[ Top ]

method getRawFilesList [line 1104]

array getRawFilesList( string $remoteDirectory)

Get raw files list



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $remoteDirectory   Remote directory

[ Top ]

method getServerOption [line 218]

boolean getServerOption( integer $optionName)

Get server option



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

integer   $optionName   Options name

[ Top ]

method getSysType [line 1128]

string getSysType( )

Get system type



Tags:

throws:  PhpFtp_Exception
access:  public


[ Top ]

method isConnected [line 171]

boolean isConnected( )

Check if connection is established with FTP server



Tags:

access:  public


[ Top ]

method raw [line 1188]

mixed raw( string $command)

Execute raw command



Tags:

access:  public


Parameters:

string   $command   Command to execute

[ Top ]

method rename [line 988]

boolean rename( string $source, string $destination)

Rename/move a remote file or folder



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $source   Source file or folder
string   $destination   Destination file or folder

[ Top ]

method setOptions [line 98]

void setOptions( $options)

Set options



Tags:

access:  public


Parameters:

array   $options   Options to set

[ Top ]

method setPasv [line 258]

boolean setPasv( [boolean $pasv = true])

Set passive mode



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

boolean   $pasv   Passive mode

[ Top ]

method setServerOption [line 196]

boolean setServerOption( integer $optionName, mixed $optionValue)

Set server option



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

integer   $optionName   Options name
mixed   $optionValue   Options value

[ Top ]

method setTimeout [line 109]

boolean setTimeout( integer $timeout)

Set timeout



Tags:

access:  public


Parameters:

integer   $timeout   Timeout value in seconds

[ Top ]

method uploadDirectory [line 718]

boolean uploadDirectory( string $localDirectory, string $remoteDirectory, [ $contextualOptions = array()])

Upload a directory recursive to ftp server



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $localDirectory   Local directory
string   $remoteDirectory   Remote directory
array   $contextualOptions   Contextual options

[ Top ]

method uploadFile [line 326]

boolean uploadFile( string $localFile, string $remoteFile, [ $contextualOptions = array()])

Upload a file to ftp server



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

string   $localFile   Local file path
string   $remoteFile   Remote file path
array   $contextualOptions   Contextual options

[ Top ]

method uploadList [line 1048]

boolean uploadList( $filesList, string $remoteDirectory, [ $contextualOptions = array()])

Upload a list of files/directories



Tags:

throws:  PhpFtp_Exception
access:  public


Parameters:

array   $filesList   Files or directories list
string   $remoteDirectory   Remote directory where to upload
array   $contextualOptions   Contextual options

[ Top ]

method _chmodNumeric [line 1315]

string _chmodNumeric( string $mode)

Return chmod string in numeric format



Tags:

access:  protected


Parameters:

string   $mode   Chmod string

[ Top ]

method _connect [line 1200]

void _connect( )

Connect to FTP server



Tags:

throws:  PhpFtp_Exception
access:  protected


[ Top ]

method _dirname [line 1268]

string _dirname( string $path)

Return the dirname from a path



Tags:

access:  protected


Parameters:

string   $path   Path string

[ Top ]

method _downloadFile [line 1252]

boolean _downloadFile( string $localFile, string $remoteFile, [integer $startPosition = 0])

Download a remote file



Tags:

access:  protected


Parameters:

string   $localFile   Local file
string   $remoteFile   Remote file
integer   $startPosition   Start position

[ Top ]

method _formatRawFilesList [line 1283]

array _formatRawFilesList( array $rawList)

Format raw files list



Tags:

access:  protected


Parameters:

array   $rawList   Raw files list

[ Top ]

method _log [line 1356]

void _log( string $message, string $file, integer $line)

Log message



Tags:

access:  protected


Parameters:

string   $message   Message to log
string   $file   File name
integer   $line   File line

[ Top ]

method _uploadFile [line 1234]

boolean _uploadFile( string $localFile, string $remoteFile, [integer $startPosition = 0])

Upload a local file to the server



Tags:

access:  protected


Parameters:

string   $localFile   Local file
string   $remoteFile   Remote file
integer   $startPosition   Start position

[ Top ]


Class Constants

OPT_HOST =  'host'

[line 28]


[ Top ]

OPT_LOG_METHOD =  'log_method'

[line 38]


[ Top ]

OPT_MODE =  'mode'

[line 27]


[ Top ]

OPT_OVERWRITE =  'overwrite'

[line 36]


[ Top ]

OPT_PASSWORD =  'password'

[line 31]


[ Top ]

OPT_PASV =  'pasv'

[line 33]


[ Top ]

OPT_PORT =  'port'

[line 29]


[ Top ]

OPT_REMOVE_UPLOADED =  'remove_uploaded'

[line 37]


[ Top ]

OPT_RESUME =  'resume'

[line 39]


[ Top ]

OPT_RETRY_COUNT =  'retry_count'

[line 41]


[ Top ]

OPT_RETRY_ENABLE =  'retry_enable'

[line 40]


[ Top ]

OPT_RETRY_SLEEP =  'retry_sleep'

[line 42]


[ Top ]

OPT_SSL =  'ssl'

[line 32]


[ Top ]

OPT_TIMEOUT =  'timeout'

[line 26]

Allowed options


[ Top ]

OPT_TMP_FILE_EXTENSION =  'tmp_file_extension'

[line 35]


[ Top ]

OPT_USERNAME =  'username'

[line 30]


[ Top ]

OPT_USE_TMP_FILE =  'use_tmp_file'

[line 34]


[ Top ]



Documentation generated on Tue, 08 May 2012 07:16:58 +0200 by phpDocumentor 1.4.3