class transfer

Transfer class, wrapper for ftp/sftp/ssh

Properties

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

Methods

__construct()

Constructor - init some basic values

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

Write file to location

overwrite_file($source_file, $destination_file)

Moving file into location. If the destination file already exists it gets overwritten

make_dir($dir)

Create directory structure

copy_file($from_loc, $to_loc)

Copy file from source location to destination location

delete_file($file)

Remove file

remove_dir($dir)

Remove directory

rename($old_handle, $new_handle)

Rename a file or folder

file_exists($directory, $filename)

Check if a specified file exist.

open_session()

Open session

close_session()

Close current session

static 
methods()

Determine methods able to be used

Details

at line 41
__construct()

Constructor - init some basic values

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

Write file to location

Parameters

$destination_file
$contents

at line 91
overwrite_file($source_file, $destination_file)

Moving file into location. If the destination file already exists it gets overwritten

Parameters

$source_file
$destination_file

at line 107
make_dir($dir)

Create directory structure

Parameters

$dir

at line 147
copy_file($from_loc, $to_loc)

Copy file from source location to destination location

Parameters

$from_loc
$to_loc

at line 167
delete_file($file)

Remove file

Parameters

$file

at line 180
remove_dir($dir)

Remove directory

remove child directories?

Parameters

$dir

at line 192
rename($old_handle, $new_handle)

Rename a file or folder

Parameters

$old_handle
$new_handle

at line 204
file_exists($directory, $filename)

Check if a specified file exist.

..

Parameters

$directory
$filename

at line 224
open_session()

Open session

at line 232
close_session()

Close current session

at line 240
static methods()

Determine methods able to be used