CI_FTP Class Reference

List of all members.

Public Member Functions

 CI_FTP ($config=array())
 initialize ($config=array())
 connect ($config=array())
 _login ()
 _is_conn ()
 changedir ($path= '', $supress_debug=FALSE)
 mkdir ($path= '', $permissions=NULL)
 upload ($locpath, $rempath, $mode= 'auto', $permissions=NULL)
 rename ($old_file, $new_file, $move=FALSE)
 move ($old_file, $new_file)
 delete_file ($filepath)
 delete_dir ($filepath)
 chmod ($path, $perm)
 list_files ($path= '.')
 mirror ($locpath, $rempath)
 _getext ($filename)
 _settype ($ext)
 close ()
 _error ($line)

Public Attributes

 $hostname = ''
 $username = ''
 $password = ''
 $port = 21
 $passive = TRUE
 $debug = FALSE
 $conn_id = FALSE


Member Function Documentation

CI_FTP::_error ( line  ) 

Display error message

private

Parameters:
string 
Returns:
bool

CI_FTP::_getext ( filename  ) 

Extract the file extension

private

Parameters:
string 
Returns:
string

CI_FTP::_is_conn (  ) 

Validates the connection ID

private

Returns:
bool

CI_FTP::_login (  ) 

FTP Login

private

Returns:
bool

CI_FTP::_settype ( ext  ) 

Set the upload type

private

Parameters:
string 
Returns:
string

CI_FTP::changedir ( path = '',
supress_debug = FALSE 
)

Change direcotry

The second parameter lets us momentarily turn off debugging so that this function can be used to test for the existance of a folder without throwing an error. There's no FTP equivalent to is_dir() so we do it by trying to change to a particular directory. Internally, this paramter is only used by the "mirror" function below.

public

Parameters:
string 
bool 
Returns:
bool

CI_FTP::chmod ( path,
perm 
)

Set file permissions

public

Parameters:
string the file path
string the permissions
Returns:
bool

CI_FTP::CI_FTP ( config = array()  ) 

Constructor - Sets Preferences

The constructor can be passed an array of config values

CI_FTP::close (  ) 

Close the connection

public

Parameters:
string path to source
string path to destination
Returns:
bool

CI_FTP::connect ( config = array()  ) 

FTP Connect

public

Parameters:
array the connection values
Returns:
bool

CI_FTP::delete_dir ( filepath  ) 

Delete a folder and recursively delete everything (including sub-folders) containted within it.

public

Parameters:
string 
Returns:
bool

CI_FTP::delete_file ( filepath  ) 

Rename (or move) a file

public

Parameters:
string 
Returns:
bool

CI_FTP::initialize ( config = array()  ) 

Initialize preferences

public

Parameters:
array 
Returns:
void

CI_FTP::list_files ( path = '.'  ) 

FTP List files in the specified directory

public

Returns:
array

CI_FTP::mirror ( locpath,
rempath 
)

Read a directory and recreate it remotely

This function recursively reads a folder and everything it contains (including sub-folders) and creates a mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server.

public

Parameters:
string path to source with trailing slash
string path to destination - include the base folder with trailing slash
Returns:
bool

CI_FTP::mkdir ( path = '',
permissions = NULL 
)

Create a directory

public

Parameters:
string 
Returns:
bool

CI_FTP::move ( old_file,
new_file 
)

Move a file

public

Parameters:
string 
string 
Returns:
bool

CI_FTP::rename ( old_file,
new_file,
move = FALSE 
)

Rename (or move) a file

public

Parameters:
string 
string 
bool 
Returns:
bool

CI_FTP::upload ( locpath,
rempath,
mode = 'auto',
permissions = NULL 
)

Upload a file to the server

public

Parameters:
string 
string 
string 
Returns:
bool


Member Data Documentation

CI_FTP::$conn_id = FALSE

CI_FTP::$debug = FALSE

CI_FTP::$hostname = ''

CI_FTP::$passive = TRUE

CI_FTP::$password = ''

CI_FTP::$port = 21

CI_FTP::$username = ''


The documentation for this class was generated from the following file:

Generated on Sun Nov 16 16:09:15 2008 for CodeIgniter by  doxygen 1.5.7.1