xref: /php-src/ext/ftp/ftp.stub.php (revision 574a7e7e)
1<?php
2
3/** @generate-class-entries */
4
5namespace {
6    /**
7     * @var int
8     * @cvalue FTPTYPE_ASCII
9     */
10    const FTP_ASCII = UNKNOWN;
11    /**
12     * @var int
13     * @cvalue FTPTYPE_ASCII
14     */
15    const FTP_TEXT = UNKNOWN;
16    /**
17     * @var int
18     * @cvalue FTPTYPE_IMAGE
19     */
20    const FTP_BINARY = UNKNOWN;
21    /**
22     * @var int
23     * @cvalue FTPTYPE_IMAGE
24     */
25    const FTP_IMAGE = UNKNOWN;
26    /**
27     * @var int
28     * @cvalue PHP_FTP_AUTORESUME
29     */
30    const FTP_AUTORESUME = UNKNOWN;
31    /**
32     * @var int
33     * @cvalue PHP_FTP_OPT_TIMEOUT_SEC
34     */
35    const FTP_TIMEOUT_SEC = UNKNOWN;
36    /**
37     * @var int
38     * @cvalue PHP_FTP_OPT_AUTOSEEK
39     */
40    const FTP_AUTOSEEK = UNKNOWN;
41    /**
42     * @var int
43     * @cvalue PHP_FTP_OPT_USEPASVADDRESS
44     */
45    const FTP_USEPASVADDRESS = UNKNOWN;
46    /**
47     * @var int
48     * @cvalue PHP_FTP_FAILED
49     */
50    const FTP_FAILED = UNKNOWN;
51    /**
52     * @var int
53     * @cvalue PHP_FTP_FINISHED
54     */
55    const FTP_FINISHED = UNKNOWN;
56    /**
57     * @var int
58     * @cvalue PHP_FTP_MOREDATA
59     */
60    const FTP_MOREDATA = UNKNOWN;
61
62    function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {}
63
64    #ifdef HAVE_FTP_SSL
65    function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {}
66    #endif
67
68    function ftp_login(FTP\Connection $ftp, string $username, #[\SensitiveParameter] string $password): bool {}
69    function ftp_pwd(FTP\Connection $ftp): string|false {}
70    function ftp_cdup(FTP\Connection $ftp): bool {}
71    function ftp_chdir(FTP\Connection $ftp, string $directory): bool {}
72    function ftp_exec(FTP\Connection $ftp, string $command): bool {}
73
74    /**
75     * @return array<int, string>|null
76     * @refcount 1
77     */
78    function ftp_raw(FTP\Connection $ftp, string $command): ?array {}
79    function ftp_mkdir(FTP\Connection $ftp, string $directory): string|false {}
80    function ftp_rmdir(FTP\Connection $ftp, string $directory): bool {}
81    function ftp_chmod(FTP\Connection $ftp, int $permissions, string $filename): int|false {}
82
83    /** @param string $response */
84    function ftp_alloc(FTP\Connection $ftp, int $size, &$response = null): bool {}
85
86    /**
87     * @return array<int, string>|false
88     * @refcount 1
89     */
90    function ftp_nlist(FTP\Connection $ftp, string $directory): array|false {}
91
92    /**
93     * @return array<int, string>|false
94     * @refcount 1
95     */
96    function ftp_rawlist(FTP\Connection $ftp, string $directory, bool $recursive = false): array|false {}
97
98    /**
99     * @return array<int, array>|false
100     * @refcount 1
101     */
102    function ftp_mlsd(FTP\Connection $ftp, string $directory): array|false {}
103
104    function ftp_systype(FTP\Connection $ftp): string|false {}
105
106    /** @param resource $stream */
107    function ftp_fget(FTP\Connection $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
108
109    /** @param resource $stream */
110    function ftp_nb_fget(FTP\Connection $ftp, $stream, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int {}
111    function ftp_pasv(FTP\Connection $ftp, bool $enable): bool {}
112    function ftp_get(FTP\Connection $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
113    function ftp_nb_get(FTP\Connection $ftp, string $local_filename, string $remote_filename, int $mode = FTP_BINARY, int $offset = 0): int|false {}
114    function ftp_nb_continue(FTP\Connection $ftp): int {}
115
116    /** @param resource $stream */
117    function ftp_fput(FTP\Connection $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): bool {}
118
119    /** @param resource $stream */
120    function ftp_nb_fput(FTP\Connection $ftp, string $remote_filename, $stream, int $mode = FTP_BINARY, int $offset = 0): int {}
121    function ftp_put(FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): bool {}
122    function ftp_append(FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY): bool {}
123    function ftp_nb_put(FTP\Connection $ftp, string $remote_filename, string $local_filename, int $mode = FTP_BINARY, int $offset = 0): int|false {}
124    function ftp_size(FTP\Connection $ftp, string $filename): int {}
125    function ftp_mdtm(FTP\Connection $ftp, string $filename): int {}
126    function ftp_rename(FTP\Connection $ftp, string $from, string $to): bool {}
127    function ftp_delete(FTP\Connection $ftp, string $filename): bool {}
128    function ftp_site(FTP\Connection $ftp, string $command): bool {}
129    function ftp_close(FTP\Connection $ftp): bool {}
130
131    /** @alias ftp_close */
132    function ftp_quit(FTP\Connection $ftp): bool {}
133
134    /** @param int|bool $value */
135    function ftp_set_option(FTP\Connection $ftp, int $option, $value): bool {}
136    function ftp_get_option(FTP\Connection $ftp, int $option): int|bool {}
137}
138
139namespace FTP {
140    /**
141     * @strict-properties
142     * @not-serializable
143     */
144    final class Connection
145    {
146    }
147}
148