phpBB API Documentation
Class

ftp_fsock

class ftp_fsock extends transfer

FTP fsock transfer class

Properties

$connection
$host
$port
$username
$password
$timeout
$root_path
$tmp_path
$file_perms
$dir_perms
$data_connection

Methods

transfer()

Constructor - init some basic values

from transfer
write_file($destination_file = '', $contents = '')

Write file to location

from transfer
overwrite_file($source_file, $destination_file)

Moving file into location.

from transfer
make_dir($dir)

Create directory structure

from transfer
copy_file($from_loc, $to_loc)

Copy file from source location to destination location

from transfer
delete_file($file)

Remove file

from transfer
remove_dir($dir)

Remove directory

from transfer
rename($old_handle, $new_handle)

Rename a file or folder

from transfer
file_exists($directory, $filename)

Check if a specified file exist...

from transfer
open_session()

Open session

from transfer
close_session()

Close current session

from transfer
static  methods()

Determine methods able to be used

from transfer
ftp_fsock($host, $username, $password, $root_path, $port = 21, $timeout = 10)

Standard parameters for FTP session

static  data()

Requests data

_init()

Init FTP Session

_mkdir($dir)

Create Directory (MKDIR)

_rmdir($dir)

Remove directory (RMDIR)

_rename($old_handle, $new_handle)

Rename File

_chdir($dir = '')

Change current working directory (CHDIR)

_chmod($file, $perms)

change file permissions (CHMOD)

_put($from_file, $to_file)

Upload file to location (PUT)

_delete($file)

Delete file (DELETE)

_close()

Close ftp session (CLOSE)

_cwd()

Return current working directory (CWD) At the moment not used by parent class

_ls($dir = './')

Return list of files in a given directory (LS)

_send_command($command, $args = '', $check = true)

Send a command to server (FTP fsock only function)

_open_data_connection()

Opens a connection to send data (FTP fosck only function)

_close_data_connection()

Closes a connection used to send data

_check_command($return = false)

Check to make sure command was successful (FTP fsock only function)

Details

in transfer at line 41
public transfer()

Constructor - init some basic values

in transfer at line 55
public write_file($destination_file = '', $contents = '')

Write file to location

Parameters

$destination_file
$contents

in transfer at line 91
public overwrite_file($source_file, $destination_file)

Moving file into location.

If the destination file already exists it gets overwritten

Parameters

$source_file
$destination_file

in transfer at line 107
public make_dir($dir)

Create directory structure

Parameters

$dir

in transfer at line 147
public copy_file($from_loc, $to_loc)

Copy file from source location to destination location

Parameters

$from_loc
$to_loc

in transfer at line 167
public delete_file($file)

Remove file

Parameters

$file

in transfer at line 180
public remove_dir($dir)

Remove directory

Parameters

$dir

in transfer at line 192
public rename($old_handle, $new_handle)

Rename a file or folder

Parameters

$old_handle
$new_handle

in transfer at line 204
public file_exists($directory, $filename)

Check if a specified file exist...

Parameters

$directory
$filename

in transfer at line 224
public open_session()

Open session

in transfer at line 232
public close_session()

Close current session

in transfer at line 240
static public methods()

Determine methods able to be used

at line 515
public ftp_fsock($host, $username, $password, $root_path, $port = 21, $timeout = 10)

Standard parameters for FTP session

Parameters

$host
$username
$password
$root_path
$port
$timeout

at line 540
static public data()

Requests data

at line 558
public _init()

Init FTP Session

at line 597
public _mkdir($dir)

Create Directory (MKDIR)

Parameters

$dir

at line 606
public _rmdir($dir)

Remove directory (RMDIR)

Parameters

$dir

at line 615
public _rename($old_handle, $new_handle)

Rename File

Parameters

$old_handle
$new_handle

at line 625
public _chdir($dir = '')

Change current working directory (CHDIR)

Parameters

$dir

at line 642
public _chmod($file, $perms)

change file permissions (CHMOD)

Parameters

$file
$perms

at line 653
public _put($from_file, $to_file)

Upload file to location (PUT)

Parameters

$from_file
$to_file

at line 689
public _delete($file)

Delete file (DELETE)

Parameters

$file

at line 698
public _close()

Close ftp session (CLOSE)

at line 713
public _cwd()

Return current working directory (CWD) At the moment not used by parent class

at line 723
public _ls($dir = './')

Return list of files in a given directory (LS)

Parameters

$dir

at line 783
public _send_command($command, $args = '', $check = true)

Send a command to server (FTP fsock only function)

Parameters

$command
$args
$check

at line 804
public _open_data_connection()

Opens a connection to send data (FTP fosck only function)

at line 872
public _close_data_connection()

Closes a connection used to send data

at line 881
public _check_command($return = false)

Check to make sure command was successful (FTP fsock only function)

Parameters

$return