\League\Flysystem\AdapterFtp

Summary

Methods
Properties
Constants
copy()
readStream()
writeStream()
__construct()
setConfig()
getHost()
setHost()
setPermPublic()
setPermPrivate()
getPort()
getRoot()
setPort()
setRoot()
getUsername()
setUsername()
getPassword()
setPassword()
getTimeout()
setTimeout()
getSystemType()
setSystemType()
setEnableTimestampsOnUnixListings()
listContents()
removeDotDirectories()
has()
getSize()
getVisibility()
ensureDirectory()
getConnection()
getPermPublic()
getPermPrivate()
__destruct()
connect()
disconnect()
isConnected()
setPathPrefix()
getPathPrefix()
applyPathPrefix()
removePathPrefix()
setTransferMode()
setSsl()
setPassive()
setIgnorePassiveAddress()
setRecurseManually()
setUtf8()
write()
update()
updateStream()
rename()
delete()
deleteDir()
createDir()
getMetadata()
getMimetype()
getTimestamp()
read()
setVisibility()
No public properties found
No constants found
listDirectoryContents()
normalizeListing()
sortListing()
normalizeObject()
normalizeUnixObject()
normalizeUnixTimestamp()
normalizeWindowsObject()
detectSystemType()
detectType()
normalizePermissions()
setUtf8Mode()
setConnectionPassiveMode()
setConnectionRoot()
login()
createActualDirectory()
listDirectoryContentsRecursive()
isPureFtpdServer()
ftpRawlist()
$connection
$host
$port
$ssl
$timeout
$passive
$separator
$root
$permPublic
$permPrivate
$configurable
$systemType
$safeStorage
$enableTimestampsOnUnixListings
$pathPrefix
$pathSeparator
$transferMode
$ignorePassiveAddress
$recurseManually
$utf8
$isPureFtpd
N/A
getRawExecResponseCode()
No private properties found
N/A

Properties

$connection

$connection : mixed

Type

mixed

$host

$host : string

Type

string

$port

$port : integer

Type

integer

$ssl

$ssl : boolean

Type

boolean

$timeout

$timeout : integer

Type

integer

$passive

$passive : boolean

Type

boolean

$separator

$separator : string

Type

string

$root

$root : string|null

Type

string|null

$permPublic

$permPublic : integer

Type

integer

$permPrivate

$permPrivate : integer

Type

integer

$configurable

$configurable : array

Type

array

$systemType

$systemType : string

Type

string

$enableTimestampsOnUnixListings

$enableTimestampsOnUnixListings : boolean

True to enable timestamps for FTP servers that return unix-style listings.

Type

boolean

$pathPrefix

$pathPrefix : string|null

Type

string|null — path prefix

$pathSeparator

$pathSeparator : string

Type

string

$transferMode

$transferMode : integer

Type

integer

$ignorePassiveAddress

$ignorePassiveAddress : null|boolean

Type

null|boolean

$recurseManually

$recurseManually : boolean

Type

boolean

$utf8

$utf8 : boolean

Type

boolean

$isPureFtpd

$isPureFtpd : boolean

Type

boolean

Methods

copy()

copy(string  $path, string  $newpath) : boolean

Copy a file.

Parameters

string $path
string $newpath

Returns

boolean

readStream()

readStream(  $path) 

Parameters

$path

writeStream()

writeStream(  $path,   $resource, \League\Flysystem\Config  $config) 

Parameters

$path
$resource
\League\Flysystem\Config $config

__construct()

__construct(array  $config) 

Constructor.

Parameters

array $config

setConfig()

setConfig(array  $config) : $this

Set the config.

Parameters

array $config

Returns

$this

getHost()

getHost() : string

Returns the host.

Returns

string

setHost()

setHost(string  $host) : $this

Set the host.

Parameters

string $host

Returns

$this

setPermPublic()

setPermPublic(integer  $permPublic) : $this

Set the public permission value.

Parameters

integer $permPublic

Returns

$this

setPermPrivate()

setPermPrivate(integer  $permPrivate) : $this

Set the private permission value.

Parameters

integer $permPrivate

Returns

$this

getPort()

getPort() : integer

Returns the ftp port.

Returns

integer

getRoot()

getRoot() : string

Returns the root folder to work from.

Returns

string

setPort()

setPort(integer|string  $port) : $this

Set the ftp port.

Parameters

integer|string $port

Returns

$this

setRoot()

setRoot(string  $root) : $this

Set the root folder to work from.

Parameters

string $root

Returns

$this

getUsername()

getUsername() : string

Returns the ftp username.

Returns

string —

username

setUsername()

setUsername(string  $username) : $this

Set ftp username.

Parameters

string $username

Returns

$this

getPassword()

getPassword() : string

Returns the password.

Returns

string —

password

setPassword()

setPassword(string  $password) : $this

Set the ftp password.

Parameters

string $password

Returns

$this

getTimeout()

getTimeout() : integer

Returns the amount of seconds before the connection will timeout.

Returns

integer

setTimeout()

setTimeout(integer  $timeout) : $this

Set the amount of seconds before the connection should timeout.

Parameters

integer $timeout

Returns

$this

getSystemType()

getSystemType() : string

Return the FTP system type.

Returns

string

setSystemType()

setSystemType(string  $systemType) : $this

Set the FTP system type (windows or unix).

Parameters

string $systemType

Returns

$this

setEnableTimestampsOnUnixListings()

setEnableTimestampsOnUnixListings(boolean  $bool = false) : $this

True to enable timestamps for FTP servers that return unix-style listings.

Parameters

boolean $bool

Returns

$this

listContents()

listContents(  $directory = '',   $recursive = false) 

Parameters

$directory
$recursive

removeDotDirectories()

removeDotDirectories(array  $list) : array

Filter out dot-directories.

Parameters

array $list

Returns

array

has()

has(  $path) 

Parameters

$path

getSize()

getSize(  $path) 

Parameters

$path

getVisibility()

getVisibility(  $path) 

Parameters

$path

ensureDirectory()

ensureDirectory(string  $dirname) 

Ensure a directory exists.

Parameters

string $dirname

getConnection()

getConnection() : mixed

Returns

mixed

getPermPublic()

getPermPublic() : integer

Get the public permission value.

Returns

integer

getPermPrivate()

getPermPrivate() : integer

Get the private permission value.

Returns

integer

__destruct()

__destruct() 

Disconnect on destruction.

connect()

connect() 

Connect to the FTP server.

disconnect()

disconnect() 

Disconnect from the FTP server.

isConnected()

isConnected() : boolean

Check if the connection is open.

Throws

\League\Flysystem\ConnectionErrorException

Returns

boolean

setPathPrefix()

setPathPrefix(string  $prefix) : void

Set the path prefix.

Parameters

string $prefix

getPathPrefix()

getPathPrefix() : string|null

Get the path prefix.

Returns

string|null —

path prefix or null if pathPrefix is empty

applyPathPrefix()

applyPathPrefix(string  $path) : string

Prefix a path.

Parameters

string $path

Returns

string —

prefixed path

removePathPrefix()

removePathPrefix(string  $path) : string

Remove a path prefix.

Parameters

string $path

Returns

string —

path without the prefix

setTransferMode()

setTransferMode(integer  $mode) : $this

Set the transfer mode.

Parameters

integer $mode

Returns

$this

setSsl()

setSsl(boolean  $ssl) : $this

Set if Ssl is enabled.

Parameters

boolean $ssl

Returns

$this

setPassive()

setPassive(boolean  $passive = true) 

Set if passive mode should be used.

Parameters

boolean $passive

setIgnorePassiveAddress()

setIgnorePassiveAddress(boolean  $ignorePassiveAddress) 

Parameters

boolean $ignorePassiveAddress

setRecurseManually()

setRecurseManually(boolean  $recurseManually) 

Parameters

boolean $recurseManually

setUtf8()

setUtf8(boolean  $utf8) 

Parameters

boolean $utf8

write()

write(  $path,   $contents, \League\Flysystem\Config  $config) 

Parameters

$path
$contents
\League\Flysystem\Config $config

update()

update(  $path,   $contents, \League\Flysystem\Config  $config) 

Parameters

$path
$contents
\League\Flysystem\Config $config

updateStream()

updateStream(  $path,   $resource, \League\Flysystem\Config  $config) 

Parameters

$path
$resource
\League\Flysystem\Config $config

rename()

rename(  $path,   $newpath) 

Parameters

$path
$newpath

delete()

delete(  $path) 

Parameters

$path

deleteDir()

deleteDir(  $dirname) 

Parameters

$dirname

createDir()

createDir(  $dirname, \League\Flysystem\Config  $config) 

Parameters

$dirname
\League\Flysystem\Config $config

getMetadata()

getMetadata(  $path) 

Parameters

$path

getMimetype()

getMimetype(  $path) 

Parameters

$path

getTimestamp()

getTimestamp(  $path) 

Parameters

$path

read()

read(  $path) 

Parameters

$path

setVisibility()

setVisibility(  $path,   $visibility) 

Parameters

$path
$visibility

listDirectoryContents()

listDirectoryContents(string  $directory,   $recursive = true) 

Parameters

string $directory
$recursive

normalizeListing()

normalizeListing(array  $listing, string  $prefix = '') : array

Normalize a directory listing.

Parameters

array $listing
string $prefix

Returns

array —

directory listing

sortListing()

sortListing(array  $result) : array

Sort a directory listing.

Parameters

array $result

Returns

array —

sorted listing

normalizeObject()

normalizeObject(string  $item, string  $base) : array

Normalize a file entry.

Parameters

string $item
string $base

Throws

\League\Flysystem\NotSupportedException

Returns

array —

normalized file array

normalizeUnixObject()

normalizeUnixObject(string  $item, string  $base) : array

Normalize a Unix file entry.

Given $item contains: '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt'

This function will return: [ 'type' => 'file', 'path' => 'file1.txt', 'visibility' => 'public', 'size' => 409, 'timestamp' => 1566205260 ]

Parameters

string $item
string $base

Returns

array —

normalized file array

normalizeUnixTimestamp()

normalizeUnixTimestamp(string  $month, string  $day, string  $timeOrYear) : integer

Only accurate to the minute (current year), or to the day.

Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command

Note: The 'MLSD' command is a machine-readable replacement for 'LIST' but many FTP servers do not support it :(

Parameters

string $month

e.g. 'Aug'

string $day

e.g. '19'

string $timeOrYear

e.g. '09:01' OR '2015'

Returns

integer

normalizeWindowsObject()

normalizeWindowsObject(string  $item, string  $base) : array

Normalize a Windows/DOS file entry.

Parameters

string $item
string $base

Returns

array —

normalized file array

detectSystemType()

detectSystemType(string  $item) : string

Get the system type from a listing item.

Parameters

string $item

Returns

string —

the system type

detectType()

detectType(string  $permissions) : string

Get the file type from the permissions.

Parameters

string $permissions

Returns

string —

file type

normalizePermissions()

normalizePermissions(string  $permissions) : integer

Normalize a permissions string.

Parameters

string $permissions

Returns

integer

setUtf8Mode()

setUtf8Mode() 

Set the connection to UTF-8 mode.

setConnectionPassiveMode()

setConnectionPassiveMode() 

Set the connections to passive mode.

Throws

\League\Flysystem\ConnectionRuntimeException

setConnectionRoot()

setConnectionRoot() 

Set the connection root.

login()

login() 

Login.

Throws

\League\Flysystem\ConnectionRuntimeException

createActualDirectory()

createActualDirectory(string  $directory, resource  $connection) : boolean

Create a directory.

Parameters

string $directory
resource $connection

Returns

boolean

listDirectoryContentsRecursive()

listDirectoryContentsRecursive(string  $directory) 

Parameters

string $directory

isPureFtpdServer()

isPureFtpdServer() : boolean

Returns

boolean

ftpRawlist()

ftpRawlist(string  $options, string  $path) : array

The ftp_rawlist function with optional escaping.

Parameters

string $options
string $path

Returns

array

getRawExecResponseCode()

getRawExecResponseCode(  $command) 

Parameters

$command