FTPService
class FTPService implements ServiceInterface (View source)
Methods
Connect to the FTP server.
Disconnect from the FTP server.
Change path.
Configure service
Return the current working directory.
Store directly the upload file
Get ftp connection
Append content a file.
Write to the beginning of a file specify
Get file content
Put other file content in given file
List files in a directory
List the directory content
List directories
Create a directory
Create a directory.
Copy the contents of a source file to a target file.
Rename or move a source file to a target file.
isFile alias of is_file.
isDirectory alias of is_dir.
Resolves a path.
Check that a file exists
Delete file
Details
void
connect()
Connect to the FTP server.
void
disconnect()
Disconnect from the FTP server.
void
changePath(string|null $path = null)
Change path.
static FilesystemInterface
configure(array $config)
Configure service
mixed
getCurrentDirectory()
Return the current working directory.
array|bool|string
store(UploadedFile $file, string|null $location = null, array $option = [])
Store directly the upload file
Connection
getConnection()
Get ftp connection
bool
append(string $file, string $content)
Append content a file.
bool
prepend(string $file, string $content)
Write to the beginning of a file specify
string|null
get(string $file)
Get file content
bool
put(string $file, string $content)
Put other file content in given file
array
files(string $dirname = '.')
List files in a directory
protected array
listDirectoryContents(string $directory = '.')
List the directory content
array
directories(string $dirname = '.')
List directories
bool
makeDirectory(string $dirname, int $mode = 0777)
Create a directory
protected bool
makeActualDirectory(string $directory)
Create a directory.
bool
copy(string $source, string $target)
Copy the contents of a source file to a target file.
bool
move(string $source, string $target)
Rename or move a source file to a target file.
bool
isFile(string $file)
isFile alias of is_file.
bool
isDirectory(string $dirname)
isDirectory alias of is_dir.
string
path(string $file)
Resolves a path.
Give the absolute path of a path
bool
exists(string $file)
Check that a file exists
bool
delete(string $file)
Delete file