PHP 클래스 CI_FTP, TastyIgniter

저자: EllisLab Dev Team
파일 보기 프로젝트 열기: tastyigniter/tastyigniter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$debug boolean Specifies whether to display error messages.
$hostname string FTP Server hostname
$passive boolean Passive mode flag
$password string FTP Password
$port integer FTP Server port
$username string FTP Username

보호된 프로퍼티들

프로퍼티 타입 설명
$conn_id resource Connection ID

공개 메소드들

메소드 설명
__construct ( array $config = [] ) : void Constructor
changedir ( string $path, boolean $suppress_debug = FALSE ) : boolean Change directory
chmod ( string $path, integer $perm ) : boolean Set file permissions
close ( ) : boolean Close the connection
connect ( array $config = [] ) : boolean FTP Connect
delete_dir ( string $filepath ) : boolean Delete a folder and recursively delete everything (including sub-folders) contained within it.
delete_file ( string $filepath ) : boolean Rename (or move) a file
download ( string $rempath, string $locpath, string $mode = 'auto' ) : boolean Download a file from a remote server to the local server
initialize ( array $config = [] ) : void Initialize preferences
list_files ( string $path = '.' ) : array FTP List files in the specified directory
mirror ( string $locpath, string $rempath ) : boolean Read a directory and recreate it remotely
mkdir ( string $path, integer $permissions = NULL ) : boolean Create a directory
move ( string $old_file, string $new_file ) : boolean Move a file
rename ( string $old_file, string $new_file, boolean $move = FALSE ) : boolean Rename (or move) a file
upload ( string $locpath, string $rempath, string $mode = 'auto', integer $permissions = NULL ) : boolean Upload a file to the server

보호된 메소드들

메소드 설명
_error ( string $line ) : void Display error message
_getext ( string $filename ) : string Extract the file extension
_is_conn ( ) : boolean Validates the connection ID
_login ( ) : boolean FTP Login
_settype ( string $ext ) : string Set the upload type

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( array $config = [] ) : void
$config array
리턴 void

_error() 보호된 메소드

Display error message
protected _error ( string $line ) : void
$line string
리턴 void

_getext() 보호된 메소드

Extract the file extension
protected _getext ( string $filename ) : string
$filename string
리턴 string

_is_conn() 보호된 메소드

Validates the connection ID
protected _is_conn ( ) : boolean
리턴 boolean

_login() 보호된 메소드

FTP Login
protected _login ( ) : boolean
리턴 boolean

_settype() 보호된 메소드

Set the upload type
protected _settype ( string $ext ) : string
$ext string Filename extension
리턴 string

changedir() 공개 메소드

The second parameter lets us momentarily turn off debugging so that this function can be used to test for the existence 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 parameter is only used by the "mirror" function below.
public changedir ( string $path, boolean $suppress_debug = FALSE ) : boolean
$path string
$suppress_debug boolean
리턴 boolean

chmod() 공개 메소드

Set file permissions
public chmod ( string $path, integer $perm ) : boolean
$path string File path
$perm integer Permissions
리턴 boolean

close() 공개 메소드

Close the connection
public close ( ) : boolean
리턴 boolean

connect() 공개 메소드

FTP Connect
public connect ( array $config = [] ) : boolean
$config array Connection values
리턴 boolean

delete_dir() 공개 메소드

Delete a folder and recursively delete everything (including sub-folders) contained within it.
public delete_dir ( string $filepath ) : boolean
$filepath string
리턴 boolean

delete_file() 공개 메소드

Rename (or move) a file
public delete_file ( string $filepath ) : boolean
$filepath string
리턴 boolean

download() 공개 메소드

Download a file from a remote server to the local server
public download ( string $rempath, string $locpath, string $mode = 'auto' ) : boolean
$rempath string
$locpath string
$mode string
리턴 boolean

initialize() 공개 메소드

Initialize preferences
public initialize ( array $config = [] ) : void
$config array
리턴 void

list_files() 공개 메소드

FTP List files in the specified directory
public list_files ( string $path = '.' ) : array
$path string
리턴 array

mirror() 공개 메소드

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 mirror ( string $locpath, string $rempath ) : boolean
$locpath string Path to source with trailing slash
$rempath string Path to destination - include the base folder with trailing slash
리턴 boolean

mkdir() 공개 메소드

Create a directory
public mkdir ( string $path, integer $permissions = NULL ) : boolean
$path string
$permissions integer
리턴 boolean

move() 공개 메소드

Move a file
public move ( string $old_file, string $new_file ) : boolean
$old_file string
$new_file string
리턴 boolean

rename() 공개 메소드

Rename (or move) a file
public rename ( string $old_file, string $new_file, boolean $move = FALSE ) : boolean
$old_file string
$new_file string
$move boolean
리턴 boolean

upload() 공개 메소드

Upload a file to the server
public upload ( string $locpath, string $rempath, string $mode = 'auto', integer $permissions = NULL ) : boolean
$locpath string
$rempath string
$mode string
$permissions integer
리턴 boolean

프로퍼티 상세

$conn_id 보호되어 있는 프로퍼티

Connection ID
protected resource $conn_id
리턴 resource

$debug 공개적으로 프로퍼티

Specifies whether to display error messages.
public bool $debug
리턴 boolean

$hostname 공개적으로 프로퍼티

FTP Server hostname
public string $hostname
리턴 string

$passive 공개적으로 프로퍼티

Passive mode flag
public bool $passive
리턴 boolean

$password 공개적으로 프로퍼티

FTP Password
public string $password
리턴 string

$port 공개적으로 프로퍼티

FTP Server port
public int $port
리턴 integer

$username 공개적으로 프로퍼티

FTP Username
public string $username
리턴 string