Zymba Documentation
FTP.Client
Text
object @FTP.Client(@Base) {
construct(string $server, string $username, string $password, int $timeout) {}
append(string $path, string $target): $this {}
close() {}
countDirectories(string $path): int {}
countFiles(string $path): int {}
createDirectory(string $path): $this {}
delete(string $path): $this {}
disablePassiveMode(): $this {}
download(string $path, string $target): $this {}
echo(string $path): $this {}
enablePassiveMode(): $this {}
execute(string $command): object {}
exists(string $path): bool {}
exit() {}
getLastModified(string $path): int {}
getSize(string $path): int {}
getWorkingDirectory(): string {}
isConnected(): bool {}
isDirectory(string $path): bool {}
listDirectories(string $path): object {}
listFiles(string $path): object {}
move(string $path, string $target): $this {}
read(string $path, ?int $length, int $position): string {}
readCSV(string $path, string $delimiter): object {}
readJSON(string $path): mixed {}
setPermissions(string $path, int $mode): $this {}
setTimeout(int $timeout): $this {}
setWorkingDirectory(string $path): $this {}
upload(string $path, string $target, int $position): $this {}
write(string $path, string $string, ?int $length, int $position): int {}
}
FTP client prototype.
Prototype
Methods
Opens a FTP connection to a specific server and attempts login.
CODE
$this.construct(string $server, string $username, string $password, int $timeout): void
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| server | string | "" | |
| username | string | "anonymous" | |
| password | string | "" | |
| timeout | int | 60 |
Closes this client and frees its associated resources.
CODE
$this.close(): void
Closes this client and frees its associated resources for the purpose of contextualization.
CODE
$this.exit(): void
Gets the path of the current working directory.
CODE
$this.getWorkingDirectory(): string
Returns
| Type | Value |
|---|---|
string |
Writes a string to a file in binary mode up to a specific byte-based length and returns the number of bytes written.
CODE
$this.write(string $path, string $string, ?int $length, int $position): int
Parameters
| Name | Type | Value | Default |
|---|---|---|---|
| path | string | "" | |
| string | string | "" | |
| length | ?int | maximum length | |
| position | int | 0 |
Returns
| Type | Value |
|---|---|
int |