PHP Class Gaufrette\Adapter\Ftp

This adapter is not cached, if you need it to be cached, please see the CachedFtp adapter which is a proxy class implementing a cache layer.
Author: Antoine Hérault ([email protected])
Inheritance: implements Gaufrette\Adapter
Datei anzeigen Open project: knplabs/gaufrette

Protected Properties

Property Type Description
$connection
$create
$directory
$fileData
$host
$mode
$passive
$password
$port
$ssl
$username
$utf8

Public Methods

Method Description
__construct ( string $directory, string $host, array $options = [] )
createFile ( $key, Gaufrette\Filesystem $filesystem )
delete ( $key )
exists ( $key )
isDirectory ( $key )
keys ( )
listDirectory ( string $directory = '' ) : array Lists files from the specified directory. If a pattern is specified, it only returns files matching it.
listKeys ( $prefix = '' )
mtime ( $key )
read ( $key )
rename ( $sourceKey, $targetKey )
write ( $key, $content )

Protected Methods

Method Description
createDirectory ( string $directory ) Creates the specified directory and its parent directories.
ensureDirectoryExists ( string $directory, boolean $create = false ) Ensures the specified directory exists. If it does not, and the create parameter is set to TRUE, it tries to create it.

Private Methods

Method Description
close ( ) Closes the adapter's ftp connection.
computePath ( string $key ) Computes the path for the given key.
connect ( ) Opens the adapter's ftp connection.
fetchKeys ( $directory = '', $onlyKeys = true )
getConnection ( ) : resource Returns an opened ftp connection resource. If the connection is not already opened, it open it before.
isConnected ( ) : boolean Indicates whether the adapter has an open ftp connection.
isDir ( string $directory ) : boolean
isLinuxListing ( $info )
parseRawlist ( array $rawlist ) : array Parses the given raw list.

Method Details

__construct() public method

public __construct ( string $directory, string $host, array $options = [] )
$directory string The directory to use in the ftp server
$host string The host of the ftp server
$options array The options like port, username, password, passive, create, mode

createDirectory() protected method

Creates the specified directory and its parent directories.
protected createDirectory ( string $directory )
$directory string Directory to create

createFile() public method

public createFile ( $key, Gaufrette\Filesystem $filesystem )
$filesystem Gaufrette\Filesystem

delete() public method

public delete ( $key )

ensureDirectoryExists() protected method

Ensures the specified directory exists. If it does not, and the create parameter is set to TRUE, it tries to create it.
protected ensureDirectoryExists ( string $directory, boolean $create = false )
$directory string
$create boolean Whether to create the directory if it does not exist

exists() public method

public exists ( $key )

isDirectory() public method

public isDirectory ( $key )

keys() public method

public keys ( )

listDirectory() public method

Lists files from the specified directory. If a pattern is specified, it only returns files matching it.
public listDirectory ( string $directory = '' ) : array
$directory string The path of the directory to list from
return array An array of keys and dirs

listKeys() public method

public listKeys ( $prefix = '' )

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

$connection protected_oe property

protected $connection

$create protected_oe property

protected $create

$directory protected_oe property

protected $directory

$fileData protected_oe property

protected $fileData

$host protected_oe property

protected $host

$mode protected_oe property

protected $mode

$passive protected_oe property

protected $passive

$password protected_oe property

protected $password

$port protected_oe property

protected $port

$ssl protected_oe property

protected $ssl

$username protected_oe property

protected $username

$utf8 protected_oe property

protected $utf8