xref: /PHP-7.0/ext/mysqli/mysqli_fe.c (revision 938f256e)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2017 The PHP Group                                |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Authors: Georg Richter <georg@php.net>                               |
16   |          Andrey Hristov <andrey@php.net>                             |
17   |          Ulf Wendel <uw@php.net>                                     |
18   +----------------------------------------------------------------------+
19 
20   $Id$
21 */
22 
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26 
27 #include <signal.h>
28 
29 #include "php.h"
30 #include "php_ini.h"
31 #include "ext/standard/info.h"
32 #include "php_mysqli_structs.h"
33 #include "mysqli_fe.h"
34 #include "mysqli_priv.h"
35 
36 #ifdef MYSQLI_USE_FULL_TYPED_ARGINFO_0
37 #define MYSQLI_ZEND_ARG_OBJ_INFO_LINK() ZEND_ARG_OBJ_INFO(0, link, mysqli, 0)
38 #define MYSQLI_ZEND_ARG_OBJ_INFO_RESULT() ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0)
39 #define MYSQLI_ZEND_ARG_OBJ_INFO_STMT() ZEND_ARG_OBJ_INFO(0, stmt, mysqli_stmt, 0)
40 #else
41 #define MYSQLI_ZEND_ARG_OBJ_INFO_LINK() ZEND_ARG_INFO(0, link)
42 #define MYSQLI_ZEND_ARG_OBJ_INFO_RESULT() ZEND_ARG_INFO(0, result)
43 #define MYSQLI_ZEND_ARG_OBJ_INFO_STMT() ZEND_ARG_INFO(0, stmt)
44 #endif
45 
46 ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_result, 0)
47 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
48 	ZEND_ARG_VARIADIC_INFO(1, vars)
49 ZEND_END_ARG_INFO()
50 
51 ZEND_BEGIN_ARG_INFO(arginfo_mysqli_stmt_bind_param, 0)
52 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
53 	ZEND_ARG_INFO(0, types)
54 	ZEND_ARG_VARIADIC_INFO(1, vars)
55 ZEND_END_ARG_INFO()
56 
57 ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_result, 0)
58 	ZEND_ARG_VARIADIC_INFO(1, vars)
59 ZEND_END_ARG_INFO()
60 
61 ZEND_BEGIN_ARG_INFO(arginfo_class_mysqli_stmt_bind_param, 0)
62 	ZEND_ARG_INFO(0, types)
63 	ZEND_ARG_VARIADIC_INFO(1, vars)
64 ZEND_END_ARG_INFO()
65 
66 ZEND_BEGIN_ARG_INFO(all_args_force_by_ref, 0)
67 	ZEND_ARG_VARIADIC_INFO(1, vars)
68 ZEND_END_ARG_INFO()
69 
70 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_poll, 0, 0, 4)
71 	ZEND_ARG_ARRAY_INFO(1, read, 1)
72 	ZEND_ARG_ARRAY_INFO(1, write, 1)
73 	ZEND_ARG_ARRAY_INFO(1, error, 1)
74 	ZEND_ARG_INFO(0, sec)
75 	ZEND_ARG_INFO(0, usec)
76 ZEND_END_ARG_INFO()
77 
78 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_no_params, 0, 0, 0)
79 ZEND_END_ARG_INFO()
80 
81 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_only_link, 0, 0, 1)
82 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
83 ZEND_END_ARG_INFO()
84 
85 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_autocommit, 0, 0, 2)
86 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
87 	ZEND_ARG_INFO(0, mode)
88 ZEND_END_ARG_INFO()
89 
90 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_autocommit, 0, 0, 1)
91 	ZEND_ARG_INFO(0, mode)
92 ZEND_END_ARG_INFO()
93 
94 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_begin_transaction, 0, 0, 1)
95 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
96 	ZEND_ARG_INFO(0, flags)
97 	ZEND_ARG_INFO(0, name)
98 ZEND_END_ARG_INFO()
99 
100 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_begin_transaction, 0, 0, 0)
101 	ZEND_ARG_INFO(0, flags)
102 	ZEND_ARG_INFO(0, name)
103 ZEND_END_ARG_INFO()
104 
105 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_savepoint, 0, 0, 2)
106 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
107 	ZEND_ARG_INFO(0, name)
108 ZEND_END_ARG_INFO()
109 
110 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_savepoint, 0, 0, 1)
111 	ZEND_ARG_INFO(0, name)
112 ZEND_END_ARG_INFO()
113 
114 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_release_savepoint, 0, 0, 2)
115 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
116 	ZEND_ARG_INFO(0, name)
117 ZEND_END_ARG_INFO()
118 
119 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_release_savepoint, 0, 0, 1)
120 	ZEND_ARG_INFO(0, name)
121 ZEND_END_ARG_INFO()
122 
123 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_commit, 0, 0, 1)
124 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
125 	ZEND_ARG_INFO(0, flags)
126 	ZEND_ARG_INFO(0, name)
127 ZEND_END_ARG_INFO()
128 
129 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_commit, 0, 0, 0)
130 	ZEND_ARG_INFO(0, flags)
131 	ZEND_ARG_INFO(0, name)
132 ZEND_END_ARG_INFO()
133 
134 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_rollback, 0, 0, 1)
135 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
136 	ZEND_ARG_INFO(0, flags)
137 	ZEND_ARG_INFO(0, name)
138 ZEND_END_ARG_INFO()
139 
140 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_rollback, 0, 0, 0)
141 	ZEND_ARG_INFO(0, flags)
142 	ZEND_ARG_INFO(0, name)
143 ZEND_END_ARG_INFO()
144 
145 
146 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_store_result, 0, 0, 1)
147 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
148 	ZEND_ARG_INFO(0, flags)
149 ZEND_END_ARG_INFO()
150 
151 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_store_result, 0, 0, 0)
152 	ZEND_ARG_INFO(0, flags)
153 ZEND_END_ARG_INFO()
154 
155 
156 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_change_user, 0, 0, 4)
157 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
158 	ZEND_ARG_INFO(0, user)
159 	ZEND_ARG_INFO(0, password)
160 	ZEND_ARG_INFO(0, database)
161 ZEND_END_ARG_INFO()
162 
163 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_change_user, 0, 0, 3)
164 	ZEND_ARG_INFO(0, user)
165 	ZEND_ARG_INFO(0, password)
166 	ZEND_ARG_INFO(0, database)
167 ZEND_END_ARG_INFO()
168 
169 
170 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_connect, 0, 0, 0)
171 	ZEND_ARG_INFO(0, host)
172 	ZEND_ARG_INFO(0, user)
173 	ZEND_ARG_INFO(0, password)
174 	ZEND_ARG_INFO(0, database)
175 	ZEND_ARG_INFO(0, port)
176 	ZEND_ARG_INFO(0, socket)
177 ZEND_END_ARG_INFO()
178 
179 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_real_connect, 0, 0, 1)
180 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
181 	ZEND_ARG_INFO(0, host)
182 	ZEND_ARG_INFO(0, user)
183 	ZEND_ARG_INFO(0, password)
184 	ZEND_ARG_INFO(0, database)
185 	ZEND_ARG_INFO(0, port)
186 	ZEND_ARG_INFO(0, socket)
187 	ZEND_ARG_INFO(0, flags)
188 ZEND_END_ARG_INFO()
189 
190 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_connect, 0, 0, 0)
191 	ZEND_ARG_INFO(0, host)
192 	ZEND_ARG_INFO(0, user)
193 	ZEND_ARG_INFO(0, password)
194 	ZEND_ARG_INFO(0, database)
195 	ZEND_ARG_INFO(0, port)
196 	ZEND_ARG_INFO(0, socket)
197 	ZEND_ARG_INFO(0, flags)
198 ZEND_END_ARG_INFO()
199 
200 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_only_result, 0, 0, 1)
201 	MYSQLI_ZEND_ARG_OBJ_INFO_RESULT()
202 ZEND_END_ARG_INFO()
203 
204 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_only_statement, 0, 0, 1)
205 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
206 ZEND_END_ARG_INFO()
207 
208 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_data_seek, 0, 0, 2)
209 	MYSQLI_ZEND_ARG_OBJ_INFO_RESULT()
210 	ZEND_ARG_INFO(0, offset)
211 ZEND_END_ARG_INFO()
212 
213 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_stmt_data_seek, 0, 0, 2)
214 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
215 	ZEND_ARG_INFO(0, offset)
216 ZEND_END_ARG_INFO()
217 
218 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_data_seek, 0, 0, 1)
219 	ZEND_ARG_INFO(0, offset)
220 ZEND_END_ARG_INFO()
221 
222 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_debug, 0, 0, 1)
223 	ZEND_ARG_INFO(0, debug_options)
224 ZEND_END_ARG_INFO()
225 
226 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_result_and_fieldnr, 0, 0, 2)
227 	MYSQLI_ZEND_ARG_OBJ_INFO_RESULT()
228 	ZEND_ARG_INFO(0, field_nr)
229 ZEND_END_ARG_INFO()
230 
231 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_result_and_fieldnr, 0, 0, 1)
232 	ZEND_ARG_INFO(0, field_nr)
233 ZEND_END_ARG_INFO()
234 
235 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_fetch_array, 0, 0, 1)
236 	MYSQLI_ZEND_ARG_OBJ_INFO_RESULT()
237 	ZEND_ARG_INFO(0, result_type)
238 ZEND_END_ARG_INFO()
239 
240 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_fetch_array, 0, 0, 0)
241 	ZEND_ARG_INFO(0, result_type)
242 ZEND_END_ARG_INFO()
243 
244 
245 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_fetch_object, 0, 0, 1)
246 #if PHP_VERSION_ID > 50399
247 	MYSQLI_ZEND_ARG_OBJ_INFO_RESULT()
248 	ZEND_ARG_INFO(0, class_name)
249 	ZEND_ARG_ARRAY_INFO(0, params, 0)
250 #endif
251 ZEND_END_ARG_INFO()
252 
253 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_fetch_object, 0, 0, 0)
254 #if PHP_VERSION_ID > 50399
255 	ZEND_ARG_INFO(0, class_name)
256 	ZEND_ARG_ARRAY_INFO(0, params, 0)
257 #endif
258 ZEND_END_ARG_INFO()
259 
260 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_kill, 0, 0, 2)
261 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
262 	ZEND_ARG_INFO(0, connection_id)
263 ZEND_END_ARG_INFO()
264 
265 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_kill, 0, 0, 1)
266 	ZEND_ARG_INFO(0, connection_id)
267 ZEND_END_ARG_INFO()
268 
269 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_query, 0, 0, 2)
270 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
271 	ZEND_ARG_INFO(0, query)
272 ZEND_END_ARG_INFO()
273 
274 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_prepare, 0, 0, 2)
275 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
276 	ZEND_ARG_INFO(0, query)
277 ZEND_END_ARG_INFO()
278 
279 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_stmt_prepare, 0, 0, 2)
280 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
281 	ZEND_ARG_INFO(0, query)
282 ZEND_END_ARG_INFO()
283 
284 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_query, 0, 0, 1)
285 	ZEND_ARG_INFO(0, query)
286 ZEND_END_ARG_INFO()
287 
288 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_options, 0, 0, 3)
289 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
290 	ZEND_ARG_INFO(0, option)
291 	ZEND_ARG_INFO(0, value)
292 ZEND_END_ARG_INFO()
293 
294 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_options, 0, 0, 2)
295 	ZEND_ARG_INFO(0, option)
296 	ZEND_ARG_INFO(0, value)
297 ZEND_END_ARG_INFO()
298 
299 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_report, 0, 0, 1)
300 	ZEND_ARG_INFO(0, flags)
301 ZEND_END_ARG_INFO()
302 
303 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_real_escape_string, 0, 0, 2)
304 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
305 	ZEND_ARG_INFO(0, string_to_escape)
306 ZEND_END_ARG_INFO()
307 
308 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_escape_string, 0, 0, 1)
309 	ZEND_ARG_INFO(0, string_to_escape)
310 ZEND_END_ARG_INFO()
311 
312 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_select_db, 0, 0, 2)
313 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
314 	ZEND_ARG_INFO(0, database)
315 ZEND_END_ARG_INFO()
316 
317 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_select_db, 0, 0, 1)
318 	ZEND_ARG_INFO(0, database)
319 ZEND_END_ARG_INFO()
320 
321 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_set_charset, 0, 0, 2)
322 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
323 	ZEND_ARG_INFO(0, charset)
324 ZEND_END_ARG_INFO()
325 
326 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_set_charset, 0, 0, 1)
327 	ZEND_ARG_INFO(0, charset)
328 ZEND_END_ARG_INFO()
329 
330 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_stmt_attr_get, 0, 0, 2)
331 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
332 	ZEND_ARG_INFO(0, attribute)
333 ZEND_END_ARG_INFO()
334 
335 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_get, 0, 0, 1)
336 	ZEND_ARG_INFO(0, attribute)
337 ZEND_END_ARG_INFO()
338 
339 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_stmt_attr_set, 0, 0, 3)
340 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
341 	ZEND_ARG_INFO(0, attribute)
342 	ZEND_ARG_INFO(0, value)
343 ZEND_END_ARG_INFO()
344 
345 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_attr_set, 0, 0, 2)
346 	ZEND_ARG_INFO(0, attribute)
347 	ZEND_ARG_INFO(0, value)
348 ZEND_END_ARG_INFO()
349 
350 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_stmt_send_long_data, 0, 0, 3)
351 	MYSQLI_ZEND_ARG_OBJ_INFO_STMT()
352 	ZEND_ARG_INFO(0, param_nr)
353 	ZEND_ARG_INFO(0, data)
354 ZEND_END_ARG_INFO()
355 
356 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_send_long_data, 0, 0, 2)
357 	ZEND_ARG_INFO(0, param_nr)
358 	ZEND_ARG_INFO(0, data)
359 ZEND_END_ARG_INFO()
360 
361 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_ssl_set, 0, 0, 6)
362 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
363 	ZEND_ARG_INFO(0, key)
364 	ZEND_ARG_INFO(0, cert)
365 	ZEND_ARG_INFO(0, certificate_authority)
366 	ZEND_ARG_INFO(0, certificate_authority_path)
367 	ZEND_ARG_INFO(0, cipher)
368 ZEND_END_ARG_INFO()
369 
370 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_ssl_set, 0, 0, 5)
371 	ZEND_ARG_INFO(0, key)
372 	ZEND_ARG_INFO(0, cert)
373 	ZEND_ARG_INFO(0, certificate_authority)
374 	ZEND_ARG_INFO(0, certificate_authority_path)
375 	ZEND_ARG_INFO(0, cipher)
376 ZEND_END_ARG_INFO()
377 
378 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_refresh, 0, 0, 2)
379 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
380 	ZEND_ARG_INFO(0, options)
381 ZEND_END_ARG_INFO()
382 
383 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_refresh, 0, 0, 1)
384 	ZEND_ARG_INFO(0, options)
385 ZEND_END_ARG_INFO()
386 
387 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_no_options, 0, 0, 0)
388 ZEND_END_ARG_INFO()
389 
390 
391 /* {{{ mysqli_functions[]
392  *
393  * Every user visible function must have an entry in mysqli_functions[].
394  */
395 const zend_function_entry mysqli_functions[] = {
396 	PHP_FE(mysqli_affected_rows,						arginfo_mysqli_only_link)
397 	PHP_FE(mysqli_autocommit,							arginfo_mysqli_autocommit)
398 	PHP_FE(mysqli_begin_transaction,					arginfo_mysqli_begin_transaction)
399 	PHP_FE(mysqli_change_user,							arginfo_mysqli_change_user)
400 	PHP_FE(mysqli_character_set_name,					arginfo_mysqli_only_link)
401 	PHP_FE(mysqli_close,								arginfo_mysqli_only_link)
402 	PHP_FE(mysqli_commit,								arginfo_mysqli_commit)
403 	PHP_FE(mysqli_connect, 								arginfo_mysqli_connect)
404 	PHP_FE(mysqli_connect_errno,						arginfo_mysqli_no_params)
405 	PHP_FE(mysqli_connect_error,						arginfo_mysqli_no_params)
406 	PHP_FE(mysqli_data_seek,							arginfo_mysqli_data_seek)
407 	PHP_FE(mysqli_dump_debug_info,						arginfo_mysqli_only_link)
408 	PHP_FE(mysqli_debug,								arginfo_mysqli_debug)
409 #if defined(HAVE_EMBEDDED_MYSQLI)
410 	PHP_FE(mysqli_embedded_server_end,					NULL)
411 	PHP_FE(mysqli_embedded_server_start,				NULL)
412 #endif
413 	PHP_FE(mysqli_errno,								arginfo_mysqli_only_link)
414 	PHP_FE(mysqli_error,								arginfo_mysqli_only_link)
415 	PHP_FE(mysqli_error_list,							arginfo_mysqli_only_link)
416 	PHP_FE(mysqli_stmt_execute,							arginfo_mysqli_only_statement)
417 	PHP_FALIAS(mysqli_execute, mysqli_stmt_execute,		arginfo_mysqli_only_statement)
418 	PHP_FE(mysqli_fetch_field,							arginfo_mysqli_only_result)
419 	PHP_FE(mysqli_fetch_fields,							arginfo_mysqli_only_result)
420 	PHP_FE(mysqli_fetch_field_direct,					arginfo_mysqli_result_and_fieldnr)
421 	PHP_FE(mysqli_fetch_lengths,						arginfo_mysqli_only_result)
422 #ifdef MYSQLI_USE_MYSQLND
423 	PHP_FE(mysqli_fetch_all,							arginfo_mysqli_fetch_array)
424 #endif
425 	PHP_FE(mysqli_fetch_array,							arginfo_mysqli_fetch_array)
426 	PHP_FE(mysqli_fetch_assoc,							arginfo_mysqli_only_result)
427 	PHP_FE(mysqli_fetch_object,							arginfo_mysqli_fetch_object)
428 	PHP_FE(mysqli_fetch_row,							arginfo_mysqli_only_result)
429 	PHP_FE(mysqli_field_count,							arginfo_mysqli_only_link)
430 	PHP_FE(mysqli_field_seek,							arginfo_mysqli_result_and_fieldnr)
431 	PHP_FE(mysqli_field_tell,							arginfo_mysqli_only_result)
432 	PHP_FE(mysqli_free_result,							arginfo_mysqli_only_result)
433 #if defined(MYSQLI_USE_MYSQLND)
434 	PHP_FE(mysqli_get_connection_stats,					arginfo_mysqli_only_link)
435 	PHP_FE(mysqli_get_client_stats,						arginfo_mysqli_no_params)
436 #endif
437 #ifdef HAVE_MYSQLI_GET_CHARSET
438 	PHP_FE(mysqli_get_charset,							arginfo_mysqli_only_link)
439 #endif
440 	PHP_FE(mysqli_get_client_info,						arginfo_mysqli_only_link)
441 	PHP_FE(mysqli_get_client_version,					arginfo_mysqli_only_link)
442 	PHP_FE(mysqli_get_links_stats,						arginfo_mysqli_no_options)
443 	PHP_FE(mysqli_get_host_info,						arginfo_mysqli_only_link)
444 	PHP_FE(mysqli_get_proto_info,						arginfo_mysqli_only_link)
445 	PHP_FE(mysqli_get_server_info,						arginfo_mysqli_only_link)
446 	PHP_FE(mysqli_get_server_version,					arginfo_mysqli_only_link)
447 	PHP_FE(mysqli_get_warnings,							arginfo_mysqli_only_link)
448 	PHP_FE(mysqli_init, 								arginfo_mysqli_no_params)
449 	PHP_FE(mysqli_info,									arginfo_mysqli_only_link)
450 	PHP_FE(mysqli_insert_id,							arginfo_mysqli_only_link)
451 	PHP_FE(mysqli_kill,									arginfo_mysqli_kill)
452 	PHP_FE(mysqli_more_results,							arginfo_mysqli_only_link)
453 	PHP_FE(mysqli_multi_query, 							arginfo_mysqli_query)
454 	PHP_FE(mysqli_next_result,							arginfo_mysqli_only_link)
455 	PHP_FE(mysqli_num_fields,							arginfo_mysqli_only_result)
456 	PHP_FE(mysqli_num_rows,								arginfo_mysqli_only_result)
457 	PHP_FE(mysqli_options, 								arginfo_mysqli_options)
458 	PHP_FE(mysqli_ping,									arginfo_mysqli_only_link)
459 #if defined(MYSQLI_USE_MYSQLND)
460 	PHP_FE(mysqli_poll,									arginfo_mysqli_poll)
461 #endif
462 	PHP_FE(mysqli_prepare,								arginfo_mysqli_prepare)
463 	PHP_FE(mysqli_report,								arginfo_mysqli_report)
464 	PHP_FE(mysqli_query,								arginfo_mysqli_query)
465 	PHP_FE(mysqli_real_connect,							arginfo_mysqli_real_connect)
466 	PHP_FE(mysqli_real_escape_string,					arginfo_mysqli_real_escape_string)
467 	PHP_FE(mysqli_real_query,							arginfo_mysqli_query)
468 #if defined(MYSQLI_USE_MYSQLND)
469 	PHP_FE(mysqli_reap_async_query,						arginfo_mysqli_only_link)
470 #endif
471 	PHP_FE(mysqli_release_savepoint,					arginfo_mysqli_release_savepoint)
472 	PHP_FE(mysqli_rollback,								arginfo_mysqli_rollback)
473 	PHP_FE(mysqli_savepoint,							arginfo_mysqli_savepoint)
474 	PHP_FE(mysqli_select_db,							arginfo_mysqli_select_db)
475 #ifdef HAVE_MYSQLI_SET_CHARSET
476 	PHP_FE(mysqli_set_charset,							arginfo_mysqli_set_charset)
477 #endif
478 	PHP_FE(mysqli_stmt_affected_rows,					arginfo_mysqli_only_statement)
479 	PHP_FE(mysqli_stmt_attr_get,						arginfo_mysqli_stmt_attr_get)
480 	PHP_FE(mysqli_stmt_attr_set,						arginfo_mysqli_stmt_attr_set)
481 	PHP_FE(mysqli_stmt_bind_param,						arginfo_mysqli_stmt_bind_param)
482 	PHP_FE(mysqli_stmt_bind_result,						arginfo_mysqli_stmt_bind_result)
483 	PHP_FE(mysqli_stmt_close,							arginfo_mysqli_only_statement)
484 	PHP_FE(mysqli_stmt_data_seek,						arginfo_mysqli_stmt_data_seek)
485 	PHP_FE(mysqli_stmt_errno,							arginfo_mysqli_only_statement)
486 	PHP_FE(mysqli_stmt_error,							arginfo_mysqli_only_statement)
487 	PHP_FE(mysqli_stmt_error_list,						arginfo_mysqli_only_statement)
488 	PHP_FE(mysqli_stmt_fetch,							arginfo_mysqli_only_statement)
489 	PHP_FE(mysqli_stmt_field_count,						arginfo_mysqli_only_statement)
490 	PHP_FE(mysqli_stmt_free_result,						arginfo_mysqli_only_statement)
491 #if defined(MYSQLI_USE_MYSQLND)
492 	PHP_FE(mysqli_stmt_get_result,						arginfo_mysqli_only_statement)
493 #endif
494 	PHP_FE(mysqli_stmt_get_warnings,					arginfo_mysqli_only_statement)
495 	PHP_FE(mysqli_stmt_init,							arginfo_mysqli_only_link)
496 	PHP_FE(mysqli_stmt_insert_id,						arginfo_mysqli_only_statement)
497 #if defined(MYSQLI_USE_MYSQLND)
498 	PHP_FE(mysqli_stmt_more_results,					arginfo_mysqli_only_statement)
499 	PHP_FE(mysqli_stmt_next_result,						arginfo_mysqli_only_statement)
500 #endif
501 	PHP_FE(mysqli_stmt_num_rows,						arginfo_mysqli_only_statement)
502 	PHP_FE(mysqli_stmt_param_count,						arginfo_mysqli_only_statement)
503 	PHP_FE(mysqli_stmt_prepare,							arginfo_mysqli_stmt_prepare)
504 	PHP_FE(mysqli_stmt_reset,							arginfo_mysqli_only_statement)
505 	PHP_FE(mysqli_stmt_result_metadata,					arginfo_mysqli_only_statement)
506 	PHP_FE(mysqli_stmt_send_long_data,					arginfo_mysqli_stmt_send_long_data)
507 	PHP_FE(mysqli_stmt_store_result,					arginfo_mysqli_only_statement)
508 	PHP_FE(mysqli_stmt_sqlstate,   						arginfo_mysqli_only_statement)
509 	PHP_FE(mysqli_sqlstate,   							arginfo_mysqli_only_link)
510 	PHP_FE(mysqli_ssl_set,								arginfo_mysqli_ssl_set)
511 	PHP_FE(mysqli_stat,									arginfo_mysqli_only_link)
512 	PHP_FE(mysqli_store_result,							arginfo_mysqli_store_result)
513 	PHP_FE(mysqli_thread_id,							arginfo_mysqli_only_link)
514 	PHP_FE(mysqli_thread_safe,							arginfo_mysqli_no_params)
515 	PHP_FE(mysqli_use_result,							arginfo_mysqli_only_link)
516 	PHP_FE(mysqli_warning_count,						arginfo_mysqli_only_link)
517 
518 	PHP_FE(mysqli_refresh,								arginfo_mysqli_refresh)
519 
520 	/* Aliases */
521 	PHP_FALIAS(mysqli_escape_string,	mysqli_real_escape_string,	arginfo_mysqli_query)
522 	PHP_FALIAS(mysqli_set_opt,			mysqli_options,				NULL)
523 
524 	PHP_FE_END
525 };
526 /* }}} */
527 
528 /* {{{ mysqli_link_methods[]
529  *
530  * Every user visible function must have an entry in mysqli_functions[].
531  */
532 const zend_function_entry mysqli_link_methods[] = {
533 	PHP_FALIAS(autocommit, mysqli_autocommit, arginfo_class_mysqli_autocommit)
534 	PHP_FALIAS(begin_transaction, mysqli_begin_transaction, arginfo_class_mysqli_begin_transaction)
535 	PHP_FALIAS(change_user,mysqli_change_user, arginfo_class_mysqli_change_user)
536 	PHP_FALIAS(character_set_name, mysqli_character_set_name, arginfo_mysqli_no_params)
537 	PHP_FALIAS(close, mysqli_close, arginfo_mysqli_no_params)
538 	PHP_FALIAS(commit, mysqli_commit, arginfo_class_mysqli_commit)
539 	PHP_FALIAS(connect, mysqli_connect, arginfo_mysqli_connect)
540 	PHP_FALIAS(dump_debug_info, mysqli_dump_debug_info, arginfo_mysqli_no_params)
541 	PHP_FALIAS(debug, mysqli_debug, arginfo_mysqli_debug)
542 #ifdef HAVE_MYSQLI_GET_CHARSET
543 	PHP_FALIAS(get_charset, mysqli_get_charset, arginfo_mysqli_no_params)
544 #endif
545 	PHP_FALIAS(get_client_info, mysqli_get_client_info, arginfo_mysqli_no_params)
546 #if defined(MYSQLI_USE_MYSQLND)
547 	PHP_FALIAS(get_connection_stats, mysqli_get_connection_stats, arginfo_mysqli_no_params)
548 #endif
549 	PHP_FALIAS(get_server_info, mysqli_get_server_info, arginfo_mysqli_no_params)
550 	PHP_FALIAS(get_warnings, mysqli_get_warnings, arginfo_mysqli_no_params)
551 	PHP_FALIAS(init,mysqli_init_method, arginfo_mysqli_no_params)
552 	PHP_FALIAS(kill,mysqli_kill, arginfo_class_mysqli_kill)
553 	PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_query)
554 	PHP_FALIAS(__construct, mysqli_link_construct, arginfo_mysqli_connect)
555 	PHP_FALIAS(more_results, mysqli_more_results, arginfo_mysqli_no_params)
556 	PHP_FALIAS(next_result, mysqli_next_result, arginfo_mysqli_no_params)
557 	PHP_FALIAS(options, mysqli_options, arginfo_class_mysqli_options)
558 	PHP_FALIAS(ping, mysqli_ping, arginfo_mysqli_no_params)
559 #if defined(MYSQLI_USE_MYSQLND)
560 	ZEND_FENTRY(poll, ZEND_FN(mysqli_poll), arginfo_mysqli_poll, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
561 #endif
562 	PHP_FALIAS(prepare, mysqli_prepare, arginfo_class_mysqli_query)
563 	PHP_FALIAS(query, mysqli_query, arginfo_class_mysqli_query)
564 	PHP_FALIAS(real_connect, mysqli_real_connect, arginfo_class_mysqli_real_connect)
565 	PHP_FALIAS(real_escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string)
566 #if defined(MYSQLI_USE_MYSQLND)
567 	PHP_FALIAS(reap_async_query, mysqli_reap_async_query, arginfo_mysqli_no_params)
568 #endif
569 	PHP_FALIAS(escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string)
570 	PHP_FALIAS(real_query, mysqli_real_query, arginfo_class_mysqli_query)
571 	PHP_FALIAS(release_savepoint, mysqli_release_savepoint, arginfo_class_mysqli_release_savepoint)
572 	PHP_FALIAS(rollback, mysqli_rollback, arginfo_class_mysqli_rollback)
573 	PHP_FALIAS(savepoint, mysqli_savepoint, arginfo_class_mysqli_savepoint)
574 	PHP_FALIAS(select_db,mysqli_select_db, arginfo_class_mysqli_select_db)
575 #ifdef HAVE_MYSQLI_SET_CHARSET
576 	PHP_FALIAS(set_charset, mysqli_set_charset, arginfo_class_mysqli_set_charset)
577 #endif
578 	PHP_FALIAS(set_opt, mysqli_options, arginfo_class_mysqli_options)
579 	PHP_FALIAS(ssl_set, mysqli_ssl_set, arginfo_class_mysqli_ssl_set)
580 	PHP_FALIAS(stat, mysqli_stat, arginfo_mysqli_no_params)
581 	PHP_FALIAS(stmt_init, mysqli_stmt_init, arginfo_mysqli_no_params)
582 	PHP_FALIAS(store_result, mysqli_store_result, arginfo_class_store_result)
583 	PHP_FALIAS(thread_safe, mysqli_thread_safe, arginfo_mysqli_no_params)
584 	PHP_FALIAS(use_result, mysqli_use_result, arginfo_mysqli_no_params)
585 	PHP_FALIAS(refresh,mysqli_refresh, arginfo_class_mysqli_refresh)
586 	{NULL, NULL, NULL}
587 };
588 /* }}} */
589 
590 /* {{{ mysqli_result_methods[]
591  *
592  * Every user visible function must have an entry in mysqli_result_functions[].
593  */
594 const zend_function_entry mysqli_result_methods[] = {
595 	PHP_FALIAS(__construct, mysqli_result_construct, NULL)
596 	PHP_FALIAS(close, mysqli_free_result, arginfo_mysqli_no_params)
597 	PHP_FALIAS(free, mysqli_free_result, arginfo_mysqli_no_params)
598 	PHP_FALIAS(data_seek, mysqli_data_seek, arginfo_class_mysqli_data_seek)
599 	PHP_FALIAS(fetch_field, mysqli_fetch_field, arginfo_mysqli_no_params)
600 	PHP_FALIAS(fetch_fields, mysqli_fetch_fields, arginfo_mysqli_no_params)
601 	PHP_FALIAS(fetch_field_direct, mysqli_fetch_field_direct, arginfo_class_mysqli_result_and_fieldnr)
602 #if defined(MYSQLI_USE_MYSQLND)
603 	PHP_FALIAS(fetch_all, mysqli_fetch_all, arginfo_class_mysqli_fetch_array)
604 #endif
605 	PHP_FALIAS(fetch_array, mysqli_fetch_array, arginfo_class_mysqli_fetch_array)
606 	PHP_FALIAS(fetch_assoc, mysqli_fetch_assoc, arginfo_mysqli_no_params)
607 	PHP_FALIAS(fetch_object,mysqli_fetch_object, arginfo_class_mysqli_fetch_object)
608 	PHP_FALIAS(fetch_row, mysqli_fetch_row, arginfo_mysqli_no_params)
609 	PHP_FALIAS(field_seek, mysqli_field_seek, arginfo_class_mysqli_result_and_fieldnr)
610 	PHP_FALIAS(free_result, mysqli_free_result, arginfo_mysqli_no_params)
611 	{NULL, NULL, NULL}
612 };
613 /* }}} */
614 
615 /* {{{ mysqli_stmt_methods[]
616  *
617  * Every user visible function must have an entry in mysqli_stmt_functions[].
618  */
619 const zend_function_entry mysqli_stmt_methods[] = {
620 	PHP_FALIAS(__construct, mysqli_stmt_construct, NULL)
621 	PHP_FALIAS(attr_get, mysqli_stmt_attr_get, arginfo_class_mysqli_stmt_attr_get)
622 	PHP_FALIAS(attr_set,mysqli_stmt_attr_set, arginfo_class_mysqli_stmt_attr_set)
623 	PHP_FALIAS(bind_param,mysqli_stmt_bind_param, arginfo_class_mysqli_stmt_bind_param)
624 	PHP_FALIAS(bind_result,mysqli_stmt_bind_result, arginfo_class_mysqli_stmt_bind_result)
625 	PHP_FALIAS(close, mysqli_stmt_close, arginfo_mysqli_no_params)
626 	PHP_FALIAS(data_seek, mysqli_stmt_data_seek, arginfo_class_mysqli_data_seek)
627 	PHP_FALIAS(execute, mysqli_stmt_execute, arginfo_mysqli_no_params)
628 	PHP_FALIAS(fetch, mysqli_stmt_fetch, arginfo_mysqli_no_params)
629 	PHP_FALIAS(get_warnings, mysqli_stmt_get_warnings,	arginfo_mysqli_no_params)
630 	PHP_FALIAS(result_metadata, mysqli_stmt_result_metadata, arginfo_mysqli_no_params)
631 #if defined(MYSQLI_USE_MYSQLND)
632 	PHP_FALIAS(more_results, mysqli_stmt_more_results, arginfo_mysqli_no_params)
633 	PHP_FALIAS(next_result, mysqli_stmt_next_result, arginfo_mysqli_no_params)
634 #endif
635 	PHP_FALIAS(num_rows, mysqli_stmt_num_rows, arginfo_mysqli_no_params)
636 	PHP_FALIAS(send_long_data, mysqli_stmt_send_long_data, arginfo_class_mysqli_stmt_send_long_data)
637 	PHP_FALIAS(free_result, mysqli_stmt_free_result, arginfo_mysqli_no_params)
638 	PHP_FALIAS(reset, mysqli_stmt_reset, arginfo_mysqli_no_params)
639 	PHP_FALIAS(prepare, mysqli_stmt_prepare, arginfo_class_mysqli_query)
640 	PHP_FALIAS(store_result, mysqli_stmt_store_result, arginfo_mysqli_no_params)
641 #if defined(MYSQLI_USE_MYSQLND)
642 	PHP_FALIAS(get_result, mysqli_stmt_get_result, arginfo_mysqli_no_params)
643 #endif
644 	{NULL, NULL, NULL}
645 };
646 /* }}} */
647 
648 /*
649  * Local variables:
650  * tab-width: 4
651  * c-basic-offset: 4
652  * End:
653  * vim600: noet sw=4 ts=4 fdm=marker
654  * vim<600: noet sw=4 ts=4
655  */
656