xref: /PHP-8.2/ext/ftp/ftp_arginfo.h (revision 574a7e7e)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 072486274a3361dee3655cfd046a293cfb8a2757 */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ftp_connect, 0, 1, FTP\\Connection, MAY_BE_FALSE)
5 	ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
6 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "21")
7 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "90")
8 ZEND_END_ARG_INFO()
9 
10 #if defined(HAVE_FTP_SSL)
11 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ftp_ssl_connect, 0, 1, FTP\\Connection, MAY_BE_FALSE)
12 	ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
13 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "21")
14 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeout, IS_LONG, 0, "90")
15 ZEND_END_ARG_INFO()
16 #endif
17 
18 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_login, 0, 3, _IS_BOOL, 0)
19 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
20 	ZEND_ARG_TYPE_INFO(0, username, IS_STRING, 0)
21 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
22 ZEND_END_ARG_INFO()
23 
24 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_pwd, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
25 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
26 ZEND_END_ARG_INFO()
27 
28 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_cdup, 0, 1, _IS_BOOL, 0)
29 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
30 ZEND_END_ARG_INFO()
31 
32 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_chdir, 0, 2, _IS_BOOL, 0)
33 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
34 	ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
35 ZEND_END_ARG_INFO()
36 
37 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_exec, 0, 2, _IS_BOOL, 0)
38 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
39 	ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0)
40 ZEND_END_ARG_INFO()
41 
42 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_raw, 0, 2, IS_ARRAY, 1)
43 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
44 	ZEND_ARG_TYPE_INFO(0, command, IS_STRING, 0)
45 ZEND_END_ARG_INFO()
46 
47 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_mkdir, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
48 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
49 	ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
50 ZEND_END_ARG_INFO()
51 
52 #define arginfo_ftp_rmdir arginfo_ftp_chdir
53 
54 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_chmod, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
55 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
56 	ZEND_ARG_TYPE_INFO(0, permissions, IS_LONG, 0)
57 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
58 ZEND_END_ARG_INFO()
59 
60 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_alloc, 0, 2, _IS_BOOL, 0)
61 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
62 	ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0)
63 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(1, response, "null")
64 ZEND_END_ARG_INFO()
65 
66 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_nlist, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
67 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
68 	ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
69 ZEND_END_ARG_INFO()
70 
71 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_rawlist, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
72 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
73 	ZEND_ARG_TYPE_INFO(0, directory, IS_STRING, 0)
74 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, recursive, _IS_BOOL, 0, "false")
75 ZEND_END_ARG_INFO()
76 
77 #define arginfo_ftp_mlsd arginfo_ftp_nlist
78 
79 #define arginfo_ftp_systype arginfo_ftp_pwd
80 
81 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_fget, 0, 3, _IS_BOOL, 0)
82 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
83 	ZEND_ARG_INFO(0, stream)
84 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
85 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
86 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
87 ZEND_END_ARG_INFO()
88 
89 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_fget, 0, 3, IS_LONG, 0)
90 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
91 	ZEND_ARG_INFO(0, stream)
92 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
93 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
94 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
95 ZEND_END_ARG_INFO()
96 
97 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_pasv, 0, 2, _IS_BOOL, 0)
98 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
99 	ZEND_ARG_TYPE_INFO(0, enable, _IS_BOOL, 0)
100 ZEND_END_ARG_INFO()
101 
102 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_get, 0, 3, _IS_BOOL, 0)
103 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
104 	ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
105 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
106 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
107 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
108 ZEND_END_ARG_INFO()
109 
110 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_nb_get, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
111 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
112 	ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
113 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
114 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
115 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
116 ZEND_END_ARG_INFO()
117 
118 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_continue, 0, 1, IS_LONG, 0)
119 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
120 ZEND_END_ARG_INFO()
121 
122 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_fput, 0, 3, _IS_BOOL, 0)
123 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
124 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
125 	ZEND_ARG_INFO(0, stream)
126 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
127 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
128 ZEND_END_ARG_INFO()
129 
130 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_nb_fput, 0, 3, IS_LONG, 0)
131 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
132 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
133 	ZEND_ARG_INFO(0, stream)
134 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
135 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
136 ZEND_END_ARG_INFO()
137 
138 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_put, 0, 3, _IS_BOOL, 0)
139 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
140 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
141 	ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
142 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
143 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
144 ZEND_END_ARG_INFO()
145 
146 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_append, 0, 3, _IS_BOOL, 0)
147 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
148 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
149 	ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
150 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
151 ZEND_END_ARG_INFO()
152 
153 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_nb_put, 0, 3, MAY_BE_LONG|MAY_BE_FALSE)
154 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
155 	ZEND_ARG_TYPE_INFO(0, remote_filename, IS_STRING, 0)
156 	ZEND_ARG_TYPE_INFO(0, local_filename, IS_STRING, 0)
157 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "FTP_BINARY")
158 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, offset, IS_LONG, 0, "0")
159 ZEND_END_ARG_INFO()
160 
161 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_size, 0, 2, IS_LONG, 0)
162 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
163 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
164 ZEND_END_ARG_INFO()
165 
166 #define arginfo_ftp_mdtm arginfo_ftp_size
167 
168 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_rename, 0, 3, _IS_BOOL, 0)
169 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
170 	ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0)
171 	ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0)
172 ZEND_END_ARG_INFO()
173 
174 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_delete, 0, 2, _IS_BOOL, 0)
175 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
176 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
177 ZEND_END_ARG_INFO()
178 
179 #define arginfo_ftp_site arginfo_ftp_exec
180 
181 #define arginfo_ftp_close arginfo_ftp_cdup
182 
183 #define arginfo_ftp_quit arginfo_ftp_cdup
184 
185 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ftp_set_option, 0, 3, _IS_BOOL, 0)
186 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
187 	ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)
188 	ZEND_ARG_INFO(0, value)
189 ZEND_END_ARG_INFO()
190 
191 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ftp_get_option, 0, 2, MAY_BE_LONG|MAY_BE_BOOL)
192 	ZEND_ARG_OBJ_INFO(0, ftp, FTP\\Connection, 0)
193 	ZEND_ARG_TYPE_INFO(0, option, IS_LONG, 0)
194 ZEND_END_ARG_INFO()
195 
196 
197 ZEND_FUNCTION(ftp_connect);
198 #if defined(HAVE_FTP_SSL)
199 ZEND_FUNCTION(ftp_ssl_connect);
200 #endif
201 ZEND_FUNCTION(ftp_login);
202 ZEND_FUNCTION(ftp_pwd);
203 ZEND_FUNCTION(ftp_cdup);
204 ZEND_FUNCTION(ftp_chdir);
205 ZEND_FUNCTION(ftp_exec);
206 ZEND_FUNCTION(ftp_raw);
207 ZEND_FUNCTION(ftp_mkdir);
208 ZEND_FUNCTION(ftp_rmdir);
209 ZEND_FUNCTION(ftp_chmod);
210 ZEND_FUNCTION(ftp_alloc);
211 ZEND_FUNCTION(ftp_nlist);
212 ZEND_FUNCTION(ftp_rawlist);
213 ZEND_FUNCTION(ftp_mlsd);
214 ZEND_FUNCTION(ftp_systype);
215 ZEND_FUNCTION(ftp_fget);
216 ZEND_FUNCTION(ftp_nb_fget);
217 ZEND_FUNCTION(ftp_pasv);
218 ZEND_FUNCTION(ftp_get);
219 ZEND_FUNCTION(ftp_nb_get);
220 ZEND_FUNCTION(ftp_nb_continue);
221 ZEND_FUNCTION(ftp_fput);
222 ZEND_FUNCTION(ftp_nb_fput);
223 ZEND_FUNCTION(ftp_put);
224 ZEND_FUNCTION(ftp_append);
225 ZEND_FUNCTION(ftp_nb_put);
226 ZEND_FUNCTION(ftp_size);
227 ZEND_FUNCTION(ftp_mdtm);
228 ZEND_FUNCTION(ftp_rename);
229 ZEND_FUNCTION(ftp_delete);
230 ZEND_FUNCTION(ftp_site);
231 ZEND_FUNCTION(ftp_close);
232 ZEND_FUNCTION(ftp_set_option);
233 ZEND_FUNCTION(ftp_get_option);
234 
235 
236 static const zend_function_entry ext_functions[] = {
237 	ZEND_FE(ftp_connect, arginfo_ftp_connect)
238 #if defined(HAVE_FTP_SSL)
239 	ZEND_FE(ftp_ssl_connect, arginfo_ftp_ssl_connect)
240 #endif
241 	ZEND_FE(ftp_login, arginfo_ftp_login)
242 	ZEND_FE(ftp_pwd, arginfo_ftp_pwd)
243 	ZEND_FE(ftp_cdup, arginfo_ftp_cdup)
244 	ZEND_FE(ftp_chdir, arginfo_ftp_chdir)
245 	ZEND_FE(ftp_exec, arginfo_ftp_exec)
246 	ZEND_FE(ftp_raw, arginfo_ftp_raw)
247 	ZEND_FE(ftp_mkdir, arginfo_ftp_mkdir)
248 	ZEND_FE(ftp_rmdir, arginfo_ftp_rmdir)
249 	ZEND_FE(ftp_chmod, arginfo_ftp_chmod)
250 	ZEND_FE(ftp_alloc, arginfo_ftp_alloc)
251 	ZEND_FE(ftp_nlist, arginfo_ftp_nlist)
252 	ZEND_FE(ftp_rawlist, arginfo_ftp_rawlist)
253 	ZEND_FE(ftp_mlsd, arginfo_ftp_mlsd)
254 	ZEND_FE(ftp_systype, arginfo_ftp_systype)
255 	ZEND_FE(ftp_fget, arginfo_ftp_fget)
256 	ZEND_FE(ftp_nb_fget, arginfo_ftp_nb_fget)
257 	ZEND_FE(ftp_pasv, arginfo_ftp_pasv)
258 	ZEND_FE(ftp_get, arginfo_ftp_get)
259 	ZEND_FE(ftp_nb_get, arginfo_ftp_nb_get)
260 	ZEND_FE(ftp_nb_continue, arginfo_ftp_nb_continue)
261 	ZEND_FE(ftp_fput, arginfo_ftp_fput)
262 	ZEND_FE(ftp_nb_fput, arginfo_ftp_nb_fput)
263 	ZEND_FE(ftp_put, arginfo_ftp_put)
264 	ZEND_FE(ftp_append, arginfo_ftp_append)
265 	ZEND_FE(ftp_nb_put, arginfo_ftp_nb_put)
266 	ZEND_FE(ftp_size, arginfo_ftp_size)
267 	ZEND_FE(ftp_mdtm, arginfo_ftp_mdtm)
268 	ZEND_FE(ftp_rename, arginfo_ftp_rename)
269 	ZEND_FE(ftp_delete, arginfo_ftp_delete)
270 	ZEND_FE(ftp_site, arginfo_ftp_site)
271 	ZEND_FE(ftp_close, arginfo_ftp_close)
272 	ZEND_FALIAS(ftp_quit, ftp_close, arginfo_ftp_quit)
273 	ZEND_FE(ftp_set_option, arginfo_ftp_set_option)
274 	ZEND_FE(ftp_get_option, arginfo_ftp_get_option)
275 	ZEND_FE_END
276 };
277 
278 
279 static const zend_function_entry class_FTP_Connection_methods[] = {
280 	ZEND_FE_END
281 };
282 
register_ftp_symbols(int module_number)283 static void register_ftp_symbols(int module_number)
284 {
285 	REGISTER_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII, CONST_PERSISTENT);
286 	REGISTER_LONG_CONSTANT("FTP_TEXT", FTPTYPE_ASCII, CONST_PERSISTENT);
287 	REGISTER_LONG_CONSTANT("FTP_BINARY", FTPTYPE_IMAGE, CONST_PERSISTENT);
288 	REGISTER_LONG_CONSTANT("FTP_IMAGE", FTPTYPE_IMAGE, CONST_PERSISTENT);
289 	REGISTER_LONG_CONSTANT("FTP_AUTORESUME", PHP_FTP_AUTORESUME, CONST_PERSISTENT);
290 	REGISTER_LONG_CONSTANT("FTP_TIMEOUT_SEC", PHP_FTP_OPT_TIMEOUT_SEC, CONST_PERSISTENT);
291 	REGISTER_LONG_CONSTANT("FTP_AUTOSEEK", PHP_FTP_OPT_AUTOSEEK, CONST_PERSISTENT);
292 	REGISTER_LONG_CONSTANT("FTP_USEPASVADDRESS", PHP_FTP_OPT_USEPASVADDRESS, CONST_PERSISTENT);
293 	REGISTER_LONG_CONSTANT("FTP_FAILED", PHP_FTP_FAILED, CONST_PERSISTENT);
294 	REGISTER_LONG_CONSTANT("FTP_FINISHED", PHP_FTP_FINISHED, CONST_PERSISTENT);
295 	REGISTER_LONG_CONSTANT("FTP_MOREDATA", PHP_FTP_MOREDATA, CONST_PERSISTENT);
296 
297 
298 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "ftp_login", sizeof("ftp_login") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
299 }
300 
register_class_FTP_Connection(void)301 static zend_class_entry *register_class_FTP_Connection(void)
302 {
303 	zend_class_entry ce, *class_entry;
304 
305 	INIT_NS_CLASS_ENTRY(ce, "FTP", "Connection", class_FTP_Connection_methods);
306 	class_entry = zend_register_internal_class_ex(&ce, NULL);
307 	class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE;
308 
309 	return class_entry;
310 }
311