Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[php] Add externs for FTP constants and functions #10409

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions std/php/Const.hx
Original file line number Diff line number Diff line change
Expand Up @@ -644,4 +644,19 @@ extern class Const {
static final CAL_MONTH_JULIAN_LONG: Int;
static final CAL_MONTH_JULIAN_SHORT: Int;
static final CAL_NUM_CALS: Int;

/**
@see http://php.net/manual/en/ftp.constants.php
**/
static final FTP_ASCII: Int;
static final FTP_AUTORESUME: Int;
static final FTP_AUTOSEEK: Int;
static final FTP_BINARY: Int;
static final FTP_FAILED: Int;
static final FTP_FINISHED: Int;
static final FTP_IMAGE: Int;
static final FTP_MOREDATA: Int;
static final FTP_TEXT: Int;
static final FTP_TIMEOUT_SEC: Int;
static final FTP_USEPASVADDRESS: Bool;
}
175 changes: 175 additions & 0 deletions std/php/Global.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1908,4 +1908,179 @@ extern class Global {
@see http://php.net/manual/en/function.tmpfile.php
**/
static function tmpfile():EitherType<Resource, Bool>;

/**
@see http://php.net/manual/en/function.ftp-alloc.php
**/
static function ftp_alloc(ftp: Resource, size: Int, ?response: Ref<String>): Bool;

/**
@see http://php.net/manual/en/function.ftp-append.php
**/
static function ftp_append(ftp: Resource, remote_filename: String, local_filename: String, ?mode: Int): Bool;

/**
@see http://php.net/manual/en/function.ftp-cdup.php
**/
static function ftp_cdup(ftp: Resource): Bool;

/**
@see http://php.net/manual/en/function.ftp-chdir.php
**/
static function ftp_chdir(ftp: Resource, directory: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-chmod.php
**/
static function ftp_chmod(ftp: Resource, permissions: Int, filename: String): EitherType<Int, Bool>;

/**
@see http://php.net/manual/en/function.ftp-close.php
**/
static function ftp_close(ftp: Resource): Bool;

/**
@see http://php.net/manual/en/function.ftp-connect.php
**/
static function ftp_connect(hostname: String, port: Int = 21, timeout: Int = 90): EitherType<Resource, Bool>;

/**
@see http://php.net/manual/en/function.ftp-delete.php
**/
static function ftp_delete(ftp: Resource, filename: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-exec.php
**/
static function ftp_exec(ftp: Resource, command: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-fget.php
**/
static function ftp_fget(ftp: Resource, stream: Resource, remote_filename: String, ?mode: Int, offset: Int = 0): Bool;

/**
@see http://php.net/manual/en/function.ftp-fput.php
**/
static function ftp_fput(ftp: Resource, remote_filename: String, stream: Resource, ?mode: Int, offset: Int = 0): Bool;

/**
@see http://php.net/manual/en/function.ftp-get.php
**/
static function ftp_get(ftp: Resource, local_filename: String, remote_filename: String, offset: Int = 0): Bool;

/**
@see http://php.net/manual/en/function.ftp-get-option.php
**/
static function ftp_get_option(ftp: Resource, option: Int): EitherType<Int, Bool>;

/**
@see http://php.net/manual/en/function.ftp-login.php
**/
static function ftp_login(ftp: Resource, username: String, password: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-mdtm.php
**/
static function ftp_mdtm(ftp: Resource, filename: String): Int;

/**
@see http://php.net/manual/en/function.ftp-mkdir.php
**/
static function ftp_mkdir(ftp: Resource, directory: String): EitherType<String, Bool>;

/**
@see http://php.net/manual/en/function.ftp-mlsd.php
**/
static function ftp_mlsd(ftp: Resource, directory: String): EitherType<NativeIndexedArray<NativeAssocArray<String>>, Bool>;

/**
@see http://php.net/manual/en/function.ftp-nb-continue.php
**/
static function ftp_nb_continue(ftp: Resource): Int;

/**
@see http://php.net/manual/en/function.ftp-nb-fget.php
**/
static function ftp_nb_fget(ftp: Resource, stream: Resource, remote_filename: String, ?mode: Int, offset: Int = 0): Int;

/**
@see http://php.net/manual/en/function.ftp-nb-fput.php
**/
static function ftp_nb_fput(ftp: Resource, remote_filename: String, stream: Resource, ?mode: Int, offset: Int = 0): Int;

/**
@see http://php.net/manual/en/function.ftp-nb-get.php
**/
static function ftp_nb_get(ftp: Resource, local_filename: String, remote_filename: String, offset: Int = 0): Int;

/**
@see http://php.net/manual/en/function.ftp-nb-put.php
**/
static function ftp_nb_put(ftp: Resource, remote_filename: String, local_filename: String, offset: Int = 0): EitherType<Int, Bool>;

/**
@see http://php.net/manual/en/function.ftp-nlist.php
**/
static function ftp_nlist(ftp: Resource, directory: String): EitherType<NativeIndexedArray<String>, Bool>;

/**
@see http://php.net/manual/en/function.ftp-pasv.php
**/
static function ftp_pasv(ftp: Resource, enable: Bool): Bool;

/**
@see http://php.net/manual/en/function.ftp-put.php
**/
static function ftp_put(ftp: Resource, remote_filename: String, local_filename: String, offset: Int = 0): Bool;

/**
@see http://php.net/manual/en/function.ftp-pwd.php
**/
static function ftp_pwd(ftp: Resource): EitherType<String, Bool>;

/**
@see http://php.net/manual/en/function.ftp-raw.php
**/
static function ftp_raw(ftp: Resource, command: String): NativeIndexedArray<String>;

/**
@see http://php.net/manual/en/function.ftp-rawlist.php
**/
static function ftp_rawlist(ftp: Resource, directory: String, recursive: Bool = false): EitherType<NativeIndexedArray<String>, Bool>;

/**
@see http://php.net/manual/en/function.ftp-rename.php
**/
static function ftp_rename(ftp: Resource, from: String, to: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-rmdir.php
**/
static function ftp_rmdir(ftp: Resource, directory: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-set-option.php
**/
static function ftp_set_option(ftp: Resource, option: Int, value: EitherType<Int, Bool>): Bool;

/**
@see http://php.net/manual/en/function.ftp-site.php
**/
static function ftp_site(ftp: Resource, command: String): Bool;

/**
@see http://php.net/manual/en/function.ftp-size.php
**/
static function ftp_size(ftp: Resource, filename: String): Int;

/**
@see http://php.net/manual/en/function.ftp-ssl-connect.php
**/
static function ftp_ssl_connect(hostname: String, port: Int = 21, timeout: Int = 90): EitherType<Resource, Bool>;

/**
@see http://php.net/manual/en/function.ftp-systype.php
**/
static function ftp_systype(ftp: Resource): EitherType<String, Bool>;
}