classe FTPService implémente ServiceInterface (Voir la source)

Méthodes

configure(array $config)

Configure service

void
connect()

Connect to the FTP server.

void
disconnect()

Disconnect from the FTP server.

void
setConnectionRoot($path = '')

Set the connection root.

Connection
getConnection()

Get ftp connextion

mixed
getCurrentDirectory()

Return the current working directory.

array|bool
store(UploadFile $file, string|null $location = null, array $option = [])

Store directly the upload file

bool
append(string $file, string $content)

Append content a file.

bool
prepend(string $file, string $content)

Write to the beginning of a file specify

bool
put(string $file, string $content)

Put other file content in given file

array
files(string $dirname = '.')

List files in a directory

array
directories(string $dirname = '.')

List directories

bool
makeDirectory(string $dirname, int $mode = 0777)

Create a directory

bool
makeActualDirectory(string $directory)

Create a directory.

string|null
get(string $filename)

Get file content

bool
copy(string $target, string $source)

Copy the contents of a source file to a target file.

bool
move(string $target, string $source)

Rename or move a source file to a target file.

bool
exists(string $filename)

Check that a file exists

bool
isFile(string $filename)

isFile alias of is_file.

bool
isDirectory(string $dirname)

isDirectory alias of is_dir.

string
path(string $filename)

Resolves a path.

bool
delete(string $file)

Delete file

array
listDirectoryContents(string $directory = '.')

List the directory content

Détails

static FilesystemInterface configure(array $config)

Configure service

Paramètres

array $config

Valeur de retour

FilesystemInterface

void connect()

Connect to the FTP server.

Valeur de retour

void

Exceptions

RuntimeException

void disconnect()

Disconnect from the FTP server.

Valeur de retour

void

void setConnectionRoot($path = '')

Set the connection root.

Paramètres

$path

Valeur de retour

void

Connection getConnection()

Get ftp connextion

Valeur de retour

Connection

mixed getCurrentDirectory()

Return the current working directory.

Valeur de retour

mixed

array|bool store(UploadFile $file, string|null $location = null, array $option = [])

Store directly the upload file

Paramètres

UploadFile $file
string|null $location
array $option

Valeur de retour

array|bool

Exceptions

InvalidArgumentException

bool append(string $file, string $content)

Append content a file.

Paramètres

string $file
string $content

Valeur de retour

bool

bool prepend(string $file, string $content)

Write to the beginning of a file specify

Paramètres

string $file
string $content

Valeur de retour

bool

Exceptions

bool put(string $file, string $content)

Put other file content in given file

Paramètres

string $file
string $content

Valeur de retour

bool

array files(string $dirname = '.')

List files in a directory

Paramètres

string $dirname

Valeur de retour

array

array directories(string $dirname = '.')

List directories

Paramètres

string $dirname

Valeur de retour

array

bool makeDirectory(string $dirname, int $mode = 0777)

Create a directory

Paramètres

string $dirname
int $mode

Valeur de retour

bool

protected bool makeActualDirectory(string $directory)

Create a directory.

Paramètres

string $directory

Valeur de retour

bool

string|null get(string $filename)

Get file content

Paramètres

string $filename

Valeur de retour

string|null

bool copy(string $target, string $source)

Copy the contents of a source file to a target file.

Paramètres

string $target
string $source

Valeur de retour

bool

bool move(string $target, string $source)

Rename or move a source file to a target file.

Paramètres

string $target
string $source

Valeur de retour

bool

bool exists(string $filename)

Check that a file exists

Paramètres

string $filename

Valeur de retour

bool

bool isFile(string $filename)

isFile alias of is_file.

Paramètres

string $filename

Valeur de retour

bool

bool isDirectory(string $dirname)

isDirectory alias of is_dir.

Paramètres

string $dirname

Valeur de retour

bool

string path(string $filename)

Resolves a path.

Give the absolute path of a path

Paramètres

string $filename

Valeur de retour

string

bool delete(string $file)

Delete file

Paramètres

string $file

Valeur de retour

bool

protected array listDirectoryContents(string $directory = '.')

List the directory content

Paramètres

string $directory

Valeur de retour

array