PHP Class Gaufrette\Adapter\Sftp

Inheritance: implements Gaufrette\Adapter, implements Gaufrette\Adapter\ChecksumCalculator
Datei anzeigen Open project: knplabs/gaufrette

Protected Properties

Property Type Description
$create
$directory
$initialized
$sftp

Public Methods

Method Description
__construct ( Ssh\Sftp $sftp, string $directory = null, boolean $create = false )
checksum ( $key )
computeKey ( string $path ) : string Computes the key from the specified path.
delete ( $key )
exists ( $key )
isDirectory ( $key )
keys ( )
mtime ( $key )
read ( $key )
rename ( $sourceKey, $targetKey )
write ( $key, $content )

Protected Methods

Method Description
computePath ( string $key ) : string Computes the path for the specified key.
createDirectory ( string $directory ) : boolean Creates the specified directory and its parents.
ensureDirectoryExists ( string $directory, boolean $create = false ) Ensures the specified directory exists.
initialize ( ) Performs the adapter's initialization.

Method Details

__construct() public method

public __construct ( Ssh\Sftp $sftp, string $directory = null, boolean $create = false )
$sftp Ssh\Sftp An Sftp instance
$directory string The distant directory
$create boolean Whether to create the remote directory if it does not exist

checksum() public method

public checksum ( $key )

computeKey() public method

Computes the key from the specified path.
public computeKey ( string $path ) : string
$path string
return string

computePath() protected method

Computes the path for the specified key.
protected computePath ( string $key ) : string
$key string
return string

createDirectory() protected method

Creates the specified directory and its parents.
protected createDirectory ( string $directory ) : boolean
$directory string The directory to create
return boolean TRUE on success, or FALSE on failure

delete() public method

public delete ( $key )

ensureDirectoryExists() protected method

Ensures the specified directory exists.
protected ensureDirectoryExists ( string $directory, boolean $create = false )
$directory string The directory that we ensure the existence
$create boolean Whether to create it if it does not exist

exists() public method

public exists ( $key )

initialize() protected method

It will ensure the root directory exists
protected initialize ( )

isDirectory() public method

public isDirectory ( $key )

keys() public method

public keys ( )

mtime() public method

public mtime ( $key )

read() public method

public read ( $key )

rename() public method

public rename ( $sourceKey, $targetKey )

write() public method

public write ( $key, $content )

Property Details

$create protected_oe property

protected $create

$directory protected_oe property

protected $directory

$initialized protected_oe property

protected $initialized

$sftp protected_oe property

protected $sftp