PHP Class FtpSource, cakephp-ftp

Inheritance: extends DataSource
ファイルを表示 Open project: fotografde/cakephp-ftp

Public Properties

Property Type Description
$config array config
$description string description

Protected Properties

Property Type Description
$_schema array _schema Default schema

Public Methods

Method Description
__construct ( array $config ) __construct
__destruct ( ) __destruct Quits
calculate ( Object $model, mixed $func, array $params = [] ) : array calculate
connect ( array $config = [] ) : boolean connect
console ( string $cmd = null ) : string console
create ( Model $model, array $fields = null, array $values = null ) : boolean create Upload/Download
delete ( Model $model, str $file = null ) : boolean delete Deletes a remote file
describe ( obj $model ) describe Dynamically describes _schema
init ( array $config = [] ) : boolean init Merges config
listSources ( $data = null ) listSources
query ( string $query = null, array $data = null ) : mixed query Provides an interface to datasource methods.
quit ( ) : boolean quit Closes and cleans up
read ( Model $model, array $queryData = [], $recursive = null ) : array read Find files on remote server
update ( Model $model, array $fields = null, array $values = null, array $conditions = null ) : boolean update Upload/Download after find

Protected Methods

Method Description
_chmodnum ( string $chmod ) : string _chmodnum
_ftp ( string $method = null, array $params = [] ) _ftp Wrapper for FTP methods for testing
_getFtp ( string $host, integer $port = 22 ) : Net_SFTP FtpSource::_getFtp()
_parseSSH ( $rawlist = [], string $path = '' ) : array _parseSSH Normalizes the results from SFTP->rawlist
_parsels ( mixed $ls = null, string $path = '' ) : array _parsels Parses results from ls command into array
getAbsolutePath ( string $path ) : string An realpath() implementaion without needing local file/dir existance

Method Details

__construct() public method

__construct
public __construct ( array $config )
$config array

__destruct() public method

__destruct Quits
public __destruct ( )

_chmodnum() protected method

_chmodnum
Author: tmp at gmx dot de
protected _chmodnum ( string $chmod ) : string
$chmod string
return string

_ftp() protected method

_ftp Wrapper for FTP methods for testing
protected _ftp ( string $method = null, array $params = [] )
$method string
$params array

_getFtp() protected method

Allows mocking of the ssh ftp class.
protected _getFtp ( string $host, integer $port = 22 ) : Net_SFTP
$host string
$port integer
return Net_SFTP Instance

_parseSSH() protected method

_parseSSH Normalizes the results from SFTP->rawlist
protected _parseSSH ( $rawlist = [], string $path = '' ) : array
$path string
return array

_parsels() protected method

You can override this in your Model by adding the method parseFtpResults($raw = array(), $path = null, $config = array()) : array()
protected _parsels ( mixed $ls = null, string $path = '' ) : array
$ls mixed
$path string
return array

calculate() public method

calculate
public calculate ( Object $model, mixed $func, array $params = [] ) : array
$model Object
$func mixed
$params array
return array

connect() public method

connect
public connect ( array $config = [] ) : boolean
$config array
return boolean

console() public method

console
public console ( string $cmd = null ) : string
$cmd string
return string

create() public method

create Upload/Download
public create ( Model $model, array $fields = null, array $values = null ) : boolean
$model Model
$fields array
$values array
return boolean

delete() public method

delete Deletes a remote file
public delete ( Model $model, str $file = null ) : boolean
$model Model
$file str
return boolean

describe() public method

describe Dynamically describes _schema
public describe ( obj $model )
$model obj

getAbsolutePath() protected method

An realpath() implementaion without needing local file/dir existance
protected getAbsolutePath ( string $path ) : string
$path string
return string

init() public method

init Merges config
public init ( array $config = [] ) : boolean
$config array
return boolean

listSources() public method

listSources
public listSources ( $data = null )

query() public method

query Provides an interface to datasource methods.
public query ( string $query = null, array $data = null ) : mixed
$query string
$data array
return mixed

quit() public method

quit Closes and cleans up
public quit ( ) : boolean
return boolean

read() public method

read Find files on remote server
public read ( Model $model, array $queryData = [], $recursive = null ) : array
$model Model
$queryData array
return array

update() public method

update Upload/Download after find
public update ( Model $model, array $fields = null, array $values = null, array $conditions = null ) : boolean
$model Model
$fields array
$values array
$conditions array
return boolean

Property Details

$_schema protected_oe property

_schema Default schema
protected array $_schema
return array

$config public_oe property

config
public array $config
return array

$description public_oe property

description
public string $description
return string