FTPService
class FTPService implements ServiceInterface (View source)
Methods
FTPService constructor
Configure service
Connect to the FTP server.
Disconnect from the FTP server.
Set the connection root.
Get ftp connextion
Return the current working directory.
Append content a file.
Write to the beginning of a file specify
Put other file content in given file
List files in a directory
List directories
Create a directory
Create a directory.
Get file content
Copy the contents of a source file to a target file.
Rename or move a source file to a target file.
Check that a file exists
isFile alias of is_file.
isDirectory alias of is_dir.
Resolves a path.
Delete file
List the directory content
Details
void
__construct(array $config)
FTPService constructor
static
configure(array $config)
Configure service
void
connect()
Connect to the FTP server.
void
disconnect()
Disconnect from the FTP server.
void
setConnectionRoot(string $path = '')
Set the connection root.
Connection
getConnection()
Get ftp connextion
string
getCurrentDirectory()
Return the current working directory.
mixed
store(UploadFile $file, string $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
protected bool
makeActualDirectory(string $directory)
Create a directory.
null|string
get(string $filename)
Get file content
bool
copy(string $target, string $source)
Copy the contents of a source file to a target file.
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.
Give the absolute path of a path
bool
delete(string $file)
Delete file
protected array
listDirectoryContents(string $directory = '.')
List the directory content