Annotation of embedaddon/php/ext/standard/basic_functions.c, revision 1.1.1.1
1.1 misho 1: /*
2: +----------------------------------------------------------------------+
3: | PHP Version 5 |
4: +----------------------------------------------------------------------+
5: | Copyright (c) 1997-2012 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: Andi Gutmans <andi@zend.com> |
16: | Zeev Suraski <zeev@zend.com> |
17: +----------------------------------------------------------------------+
18: */
19:
20: /* $Id: basic_functions.c 321634 2012-01-01 13:15:04Z felipe $ */
21:
22: #include "php.h"
23: #include "php_streams.h"
24: #include "php_main.h"
25: #include "php_globals.h"
26: #include "php_ini.h"
27: #include "php_standard.h"
28: #include "php_math.h"
29: #include "php_http.h"
30: #include "php_incomplete_class.h"
31: #include "php_getopt.h"
32: #include "ext/standard/info.h"
33: #include "ext/session/php_session.h"
34: #include "zend_operators.h"
35: #include "ext/standard/php_dns.h"
36: #include "ext/standard/php_uuencode.h"
37: #include "safe_mode.h"
38:
39: #ifdef PHP_WIN32
40: #include "win32/php_win32_globals.h"
41: #include "win32/time.h"
42: #endif
43:
44: typedef struct yy_buffer_state *YY_BUFFER_STATE;
45:
46: #include "zend.h"
47: #include "zend_ini_scanner.h"
48: #include "zend_language_scanner.h"
49: #include <zend_language_parser.h>
50:
51: #include <stdarg.h>
52: #include <stdlib.h>
53: #include <math.h>
54: #include <time.h>
55: #include <stdio.h>
56:
57: #ifndef PHP_WIN32
58: #include <sys/types.h>
59: #include <sys/stat.h>
60: #endif
61:
62: #ifdef NETWARE
63: #include <netinet/in.h>
64: #endif
65:
66: #ifndef PHP_WIN32
67: # include <netdb.h>
68: #else
69: #include "win32/inet.h"
70: #endif
71:
72: #if HAVE_ARPA_INET_H
73: # include <arpa/inet.h>
74: #endif
75:
76: #if HAVE_UNISTD_H
77: # include <unistd.h>
78: #endif
79:
80: #if HAVE_STRING_H
81: # include <string.h>
82: #else
83: # include <strings.h>
84: #endif
85:
86: #if HAVE_LOCALE_H
87: # include <locale.h>
88: #endif
89:
90: #if HAVE_SYS_MMAN_H
91: # include <sys/mman.h>
92: #endif
93:
94: #if HAVE_SYS_LOADAVG_H
95: # include <sys/loadavg.h>
96: #endif
97:
98: #ifdef PHP_WIN32
99: # include "win32/unistd.h"
100: #endif
101:
102: #ifndef INADDR_NONE
103: #define INADDR_NONE ((unsigned long int) -1)
104: #endif
105:
106: #include "zend_globals.h"
107: #include "php_globals.h"
108: #include "SAPI.h"
109: #include "php_ticks.h"
110:
111: #ifdef ZTS
112: PHPAPI int basic_globals_id;
113: #else
114: PHPAPI php_basic_globals basic_globals;
115: #endif
116:
117: #include "php_fopen_wrappers.h"
118: #include "streamsfuncs.h"
119:
120: static zend_class_entry *incomplete_class_entry = NULL;
121:
122: typedef struct _php_shutdown_function_entry {
123: zval **arguments;
124: int arg_count;
125: } php_shutdown_function_entry;
126:
127: typedef struct _user_tick_function_entry {
128: zval **arguments;
129: int arg_count;
130: int calling;
131: } user_tick_function_entry;
132:
133: /* some prototypes for local functions */
134: static void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry);
135: static void user_tick_function_dtor(user_tick_function_entry *tick_function_entry);
136:
137: #undef sprintf
138:
139: /* {{{ arginfo */
140: /* {{{ main/main.c */
141: ZEND_BEGIN_ARG_INFO(arginfo_set_time_limit, 0)
142: ZEND_ARG_INFO(0, seconds)
143: ZEND_END_ARG_INFO()
144: /* }}} */
145: /* {{{ main/output.c */
146: ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0)
147: ZEND_ARG_INFO(0, user_function)
148: ZEND_ARG_INFO(0, chunk_size)
149: ZEND_ARG_INFO(0, flags)
150: ZEND_END_ARG_INFO()
151:
152: ZEND_BEGIN_ARG_INFO(arginfo_ob_flush, 0)
153: ZEND_END_ARG_INFO()
154:
155: ZEND_BEGIN_ARG_INFO(arginfo_ob_clean, 0)
156: ZEND_END_ARG_INFO()
157:
158: ZEND_BEGIN_ARG_INFO(arginfo_ob_end_flush, 0)
159: ZEND_END_ARG_INFO()
160:
161: ZEND_BEGIN_ARG_INFO(arginfo_ob_end_clean, 0)
162: ZEND_END_ARG_INFO()
163:
164: ZEND_BEGIN_ARG_INFO(arginfo_ob_get_flush, 0)
165: ZEND_END_ARG_INFO()
166:
167: ZEND_BEGIN_ARG_INFO(arginfo_ob_get_clean, 0)
168: ZEND_END_ARG_INFO()
169:
170: ZEND_BEGIN_ARG_INFO(arginfo_ob_get_contents, 0)
171: ZEND_END_ARG_INFO()
172:
173: ZEND_BEGIN_ARG_INFO(arginfo_ob_get_level, 0)
174: ZEND_END_ARG_INFO()
175:
176: ZEND_BEGIN_ARG_INFO(arginfo_ob_get_length, 0)
177: ZEND_END_ARG_INFO()
178:
179: ZEND_BEGIN_ARG_INFO(arginfo_ob_list_handlers, 0)
180: ZEND_END_ARG_INFO()
181:
182: ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_get_status, 0, 0, 0)
183: ZEND_ARG_INFO(0, full_status)
184: ZEND_END_ARG_INFO()
185:
186: ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_implicit_flush, 0, 0, 0)
187: ZEND_ARG_INFO(0, flag)
188: ZEND_END_ARG_INFO()
189:
190: ZEND_BEGIN_ARG_INFO(arginfo_output_reset_rewrite_vars, 0)
191: ZEND_END_ARG_INFO()
192:
193: ZEND_BEGIN_ARG_INFO(arginfo_output_add_rewrite_var, 0)
194: ZEND_ARG_INFO(0, name)
195: ZEND_ARG_INFO(0, value)
196: ZEND_END_ARG_INFO()
197: /* }}} */
198: /* {{{ main/streams/userspace.c */
199: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_wrapper_register, 0, 0, 2)
200: ZEND_ARG_INFO(0, protocol)
201: ZEND_ARG_INFO(0, classname)
202: ZEND_ARG_INFO(0, flags)
203: ZEND_END_ARG_INFO()
204:
205: ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_unregister, 0)
206: ZEND_ARG_INFO(0, protocol)
207: ZEND_END_ARG_INFO()
208:
209: ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_restore, 0)
210: ZEND_ARG_INFO(0, protocol)
211: ZEND_END_ARG_INFO()
212: /* }}} */
213: /* {{{ array.c */
214: ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1)
215: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
216: ZEND_ARG_INFO(0, sort_flags)
217: ZEND_END_ARG_INFO()
218:
219: ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1)
220: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
221: ZEND_ARG_INFO(0, sort_flags)
222: ZEND_END_ARG_INFO()
223:
224: ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
225: ZEND_ARG_INFO(0, var)
226: ZEND_ARG_INFO(0, mode)
227: ZEND_END_ARG_INFO()
228:
229: ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0)
230: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
231: ZEND_END_ARG_INFO()
232:
233: ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0)
234: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
235: ZEND_END_ARG_INFO()
236:
237: ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1)
238: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
239: ZEND_ARG_INFO(0, sort_flags)
240: ZEND_END_ARG_INFO()
241:
242: ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1)
243: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
244: ZEND_ARG_INFO(0, sort_flags)
245: ZEND_END_ARG_INFO()
246:
247: ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
248: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
249: ZEND_ARG_INFO(0, sort_flags)
250: ZEND_END_ARG_INFO()
251:
252: ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1)
253: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
254: ZEND_ARG_INFO(0, sort_flags)
255: ZEND_END_ARG_INFO()
256:
257: ZEND_BEGIN_ARG_INFO(arginfo_usort, 0)
258: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
259: ZEND_ARG_INFO(0, cmp_function)
260: ZEND_END_ARG_INFO()
261:
262: ZEND_BEGIN_ARG_INFO(arginfo_uasort, 0)
263: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
264: ZEND_ARG_INFO(0, cmp_function)
265: ZEND_END_ARG_INFO()
266:
267: ZEND_BEGIN_ARG_INFO(arginfo_uksort, 0)
268: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
269: ZEND_ARG_INFO(0, cmp_function)
270: ZEND_END_ARG_INFO()
271:
272: ZEND_BEGIN_ARG_INFO(arginfo_end, 0)
273: ZEND_ARG_INFO(1, arg)
274: ZEND_END_ARG_INFO()
275:
276: ZEND_BEGIN_ARG_INFO(arginfo_prev, 0)
277: ZEND_ARG_INFO(1, arg)
278: ZEND_END_ARG_INFO()
279:
280: ZEND_BEGIN_ARG_INFO(arginfo_next, 0)
281: ZEND_ARG_INFO(1, arg)
282: ZEND_END_ARG_INFO()
283:
284: ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
285: ZEND_ARG_INFO(1, arg)
286: ZEND_END_ARG_INFO()
287:
288: ZEND_BEGIN_ARG_INFO(arginfo_current, ZEND_SEND_PREFER_REF)
289: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
290: ZEND_END_ARG_INFO()
291:
292: ZEND_BEGIN_ARG_INFO(arginfo_key, ZEND_SEND_PREFER_REF)
293: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg)
294: ZEND_END_ARG_INFO()
295:
296: ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1)
297: ZEND_ARG_INFO(0, arg1)
298: ZEND_ARG_INFO(0, arg2)
299: ZEND_ARG_INFO(0, ...)
300: ZEND_END_ARG_INFO()
301:
302: ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1)
303: ZEND_ARG_INFO(0, arg1)
304: ZEND_ARG_INFO(0, arg2)
305: ZEND_ARG_INFO(0, ...)
306: ZEND_END_ARG_INFO()
307:
308: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
309: ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
310: ZEND_ARG_INFO(0, funcname)
311: ZEND_ARG_INFO(0, userdata)
312: ZEND_END_ARG_INFO()
313:
314: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2)
315: ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
316: ZEND_ARG_INFO(0, funcname)
317: ZEND_ARG_INFO(0, userdata)
318: ZEND_END_ARG_INFO()
319:
320: ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2)
321: ZEND_ARG_INFO(0, needle)
322: ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
323: ZEND_ARG_INFO(0, strict)
324: ZEND_END_ARG_INFO()
325:
326: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_search, 0, 0, 2)
327: ZEND_ARG_INFO(0, needle)
328: ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
329: ZEND_ARG_INFO(0, strict)
330: ZEND_END_ARG_INFO()
331:
332: ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
333: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */
334: ZEND_ARG_INFO(0, extract_type)
335: ZEND_ARG_INFO(0, prefix)
336: ZEND_END_ARG_INFO()
337:
338: ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1)
339: ZEND_ARG_INFO(0, var_names)
340: ZEND_ARG_INFO(0, ...)
341: ZEND_END_ARG_INFO()
342:
343: ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
344: ZEND_ARG_INFO(0, start_key)
345: ZEND_ARG_INFO(0, num)
346: ZEND_ARG_INFO(0, val)
347: ZEND_END_ARG_INFO()
348:
349: ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0)
350: ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
351: ZEND_ARG_INFO(0, val)
352: ZEND_END_ARG_INFO()
353:
354: ZEND_BEGIN_ARG_INFO_EX(arginfo_range, 0, 0, 2)
355: ZEND_ARG_INFO(0, low)
356: ZEND_ARG_INFO(0, high)
357: ZEND_ARG_INFO(0, step)
358: ZEND_END_ARG_INFO()
359:
360: ZEND_BEGIN_ARG_INFO(arginfo_shuffle, 0)
361: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
362: ZEND_END_ARG_INFO()
363:
364: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 2)
365: ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
366: ZEND_ARG_INFO(0, var)
367: ZEND_ARG_INFO(0, ...)
368: ZEND_END_ARG_INFO()
369:
370: ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0)
371: ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
372: ZEND_END_ARG_INFO()
373:
374: ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0)
375: ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
376: ZEND_END_ARG_INFO()
377:
378: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 2)
379: ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
380: ZEND_ARG_INFO(0, var)
381: ZEND_ARG_INFO(0, ...)
382: ZEND_END_ARG_INFO()
383:
384: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
385: ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
386: ZEND_ARG_INFO(0, offset)
387: ZEND_ARG_INFO(0, length)
388: ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */
389: ZEND_END_ARG_INFO()
390:
391: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
392: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */
393: ZEND_ARG_INFO(0, offset)
394: ZEND_ARG_INFO(0, length)
395: ZEND_ARG_INFO(0, preserve_keys)
396: ZEND_END_ARG_INFO()
397:
398: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2)
399: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
400: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
401: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
402: ZEND_END_ARG_INFO()
403:
404: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2)
405: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
406: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
407: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, arg, 0) */
408: ZEND_END_ARG_INFO()
409:
410: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2)
411: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
412: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
413: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
414: ZEND_END_ARG_INFO()
415:
416: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2)
417: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
418: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg, 0) */
419: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, arg, 0) */
420: ZEND_END_ARG_INFO()
421:
422: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
423: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
424: ZEND_ARG_INFO(0, search_value)
425: ZEND_ARG_INFO(0, strict)
426: ZEND_END_ARG_INFO()
427:
428: ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0)
429: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
430: ZEND_END_ARG_INFO()
431:
432: ZEND_BEGIN_ARG_INFO(arginfo_array_count_values, 0)
433: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
434: ZEND_END_ARG_INFO()
435:
436: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1)
437: ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
438: ZEND_ARG_INFO(0, preserve_keys)
439: ZEND_END_ARG_INFO()
440:
441: ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0)
442: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
443: ZEND_ARG_INFO(0, pad_size)
444: ZEND_ARG_INFO(0, pad_value)
445: ZEND_END_ARG_INFO()
446:
447: ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0)
448: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
449: ZEND_END_ARG_INFO()
450:
451: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1)
452: ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
453: ZEND_ARG_INFO(0, case)
454: ZEND_END_ARG_INFO()
455:
456: ZEND_BEGIN_ARG_INFO(arginfo_array_unique, 0)
457: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
458: ZEND_END_ARG_INFO()
459:
460: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_key, 0, 0, 2)
461: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
462: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
463: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
464: ZEND_END_ARG_INFO()
465:
466: ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0)
467: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
468: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
469: ZEND_ARG_INFO(0, callback_key_compare_func)
470: ZEND_END_ARG_INFO()
471:
472: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect, 0, 0, 2)
473: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
474: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
475: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
476: ZEND_END_ARG_INFO()
477:
478: ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0)
479: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
480: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
481: ZEND_ARG_INFO(0, callback_data_compare_func)
482: ZEND_END_ARG_INFO()
483:
484: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_assoc, 0, 0, 2)
485: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
486: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
487: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
488: ZEND_END_ARG_INFO()
489:
490: ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0)
491: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
492: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
493: ZEND_ARG_INFO(0, callback_data_compare_func)
494: ZEND_END_ARG_INFO()
495:
496: ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_uassoc, 0)
497: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
498: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
499: ZEND_ARG_INFO(0, callback_key_compare_func)
500: ZEND_END_ARG_INFO()
501:
502: ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0)
503: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
504: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
505: ZEND_ARG_INFO(0, callback_data_compare_func)
506: ZEND_ARG_INFO(0, callback_key_compare_func)
507: ZEND_END_ARG_INFO()
508:
509: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_key, 0, 0, 2)
510: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
511: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
512: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
513: ZEND_END_ARG_INFO()
514:
515: ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0)
516: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
517: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
518: ZEND_ARG_INFO(0, callback_key_comp_func)
519: ZEND_END_ARG_INFO()
520:
521: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff, 0, 0, 2)
522: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
523: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
524: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
525: ZEND_END_ARG_INFO()
526:
527: ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0)
528: ZEND_ARG_INFO(0, arr1)
529: ZEND_ARG_INFO(0, arr2)
530: ZEND_ARG_INFO(0, callback_data_comp_func)
531: ZEND_END_ARG_INFO()
532:
533: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_assoc, 0, 0, 2)
534: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
535: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
536: ZEND_ARG_INFO(0, ...) /* ARRAY_INFO(0, ..., 0) */
537: ZEND_END_ARG_INFO()
538:
539: ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0)
540: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
541: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
542: ZEND_ARG_INFO(0, callback_data_comp_func)
543: ZEND_END_ARG_INFO()
544:
545: ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_assoc, 0)
546: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
547: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
548: ZEND_ARG_INFO(0, callback_key_comp_func)
549: ZEND_END_ARG_INFO()
550:
551: ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0)
552: ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
553: ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
554: ZEND_ARG_INFO(0, callback_data_comp_func)
555: ZEND_ARG_INFO(0, callback_key_comp_func)
556: ZEND_END_ARG_INFO()
557:
558: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, ZEND_SEND_PREFER_REF, 0, 1)
559: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */
560: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
561: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
562: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr2)
563: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_ASC_or_SORT_DESC)
564: ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, SORT_REGULAR_or_SORT_NUMERIC_or_SORT_STRING)
565: ZEND_END_ARG_INFO()
566:
567: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
568: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
569: ZEND_ARG_INFO(0, num_req)
570: ZEND_END_ARG_INFO()
571:
572: ZEND_BEGIN_ARG_INFO(arginfo_array_sum, 0)
573: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
574: ZEND_END_ARG_INFO()
575:
576: ZEND_BEGIN_ARG_INFO(arginfo_array_product, 0)
577: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
578: ZEND_END_ARG_INFO()
579:
580: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2)
581: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
582: ZEND_ARG_INFO(0, callback)
583: ZEND_ARG_INFO(0, initial)
584: ZEND_END_ARG_INFO()
585:
586: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
587: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
588: ZEND_ARG_INFO(0, callback)
589: ZEND_END_ARG_INFO()
590:
591: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
592: ZEND_ARG_INFO(0, callback)
593: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
594: ZEND_ARG_INFO(0, ...)
595: ZEND_END_ARG_INFO()
596:
597: ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
598: ZEND_ARG_INFO(0, key)
599: ZEND_ARG_INFO(0, search)
600: ZEND_END_ARG_INFO()
601:
602: ZEND_BEGIN_ARG_INFO_EX(arginfo_array_chunk, 0, 0, 2)
603: ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
604: ZEND_ARG_INFO(0, size)
605: ZEND_ARG_INFO(0, preserve_keys)
606: ZEND_END_ARG_INFO()
607:
608: ZEND_BEGIN_ARG_INFO(arginfo_array_combine, 0)
609: ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
610: ZEND_ARG_INFO(0, values) /* ARRAY_INFO(0, values, 0) */
611: ZEND_END_ARG_INFO()
612: /* }}} */
613: /* {{{ basic_functions.c */
614: ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_gpc, 0)
615: ZEND_END_ARG_INFO()
616:
617: ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_runtime, 0)
618: ZEND_END_ARG_INFO()
619:
620: ZEND_BEGIN_ARG_INFO_EX(arginfo_set_magic_quotes_runtime, 0, 0, 1)
621: ZEND_ARG_INFO(0, new_setting)
622: ZEND_END_ARG_INFO()
623:
624: ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
625: ZEND_ARG_INFO(0, const_name)
626: ZEND_END_ARG_INFO()
627:
628: #ifdef HAVE_INET_NTOP
629: ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
630: ZEND_ARG_INFO(0, in_addr)
631: ZEND_END_ARG_INFO()
632: #endif
633:
634: #ifdef HAVE_INET_PTON
635: ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
636: ZEND_ARG_INFO(0, ip_address)
637: ZEND_END_ARG_INFO()
638: #endif
639:
640: ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
641: ZEND_ARG_INFO(0, ip_address)
642: ZEND_END_ARG_INFO()
643:
644: ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0)
645: ZEND_ARG_INFO(0, proper_address)
646: ZEND_END_ARG_INFO()
647:
648: ZEND_BEGIN_ARG_INFO(arginfo_getenv, 0)
649: ZEND_ARG_INFO(0, varname)
650: ZEND_END_ARG_INFO()
651:
652: #ifdef HAVE_PUTENV
653: ZEND_BEGIN_ARG_INFO(arginfo_putenv, 0)
654: ZEND_ARG_INFO(0, setting)
655: ZEND_END_ARG_INFO()
656: #endif
657:
658: ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1)
659: ZEND_ARG_INFO(0, options)
660: ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */
661: ZEND_END_ARG_INFO()
662:
663: ZEND_BEGIN_ARG_INFO(arginfo_flush, 0)
664: ZEND_END_ARG_INFO()
665:
666: ZEND_BEGIN_ARG_INFO(arginfo_sleep, 0)
667: ZEND_ARG_INFO(0, seconds)
668: ZEND_END_ARG_INFO()
669:
670: ZEND_BEGIN_ARG_INFO(arginfo_usleep, 0)
671: ZEND_ARG_INFO(0, micro_seconds)
672: ZEND_END_ARG_INFO()
673:
674: #if HAVE_NANOSLEEP
675: ZEND_BEGIN_ARG_INFO(arginfo_time_nanosleep, 0)
676: ZEND_ARG_INFO(0, seconds)
677: ZEND_ARG_INFO(0, nanoseconds)
678: ZEND_END_ARG_INFO()
679:
680: ZEND_BEGIN_ARG_INFO(arginfo_time_sleep_until, 0)
681: ZEND_ARG_INFO(0, timestamp)
682: ZEND_END_ARG_INFO()
683: #endif
684:
685: ZEND_BEGIN_ARG_INFO(arginfo_get_current_user, 0)
686: ZEND_END_ARG_INFO()
687:
688: ZEND_BEGIN_ARG_INFO(arginfo_get_cfg_var, 0)
689: ZEND_ARG_INFO(0, option_name)
690: ZEND_END_ARG_INFO()
691:
692: ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1)
693: ZEND_ARG_INFO(0, message)
694: ZEND_ARG_INFO(0, message_type)
695: ZEND_ARG_INFO(0, destination)
696: ZEND_ARG_INFO(0, extra_headers)
697: ZEND_END_ARG_INFO()
698:
699: ZEND_BEGIN_ARG_INFO_EX(arginfo_error_get_last, 0, 0, 0)
700: ZEND_END_ARG_INFO()
701:
702: ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func, 0, 0, 1)
703: ZEND_ARG_INFO(0, function_name)
704: ZEND_ARG_INFO(0, parmeter)
705: ZEND_ARG_INFO(0, ...)
706: ZEND_END_ARG_INFO()
707:
708: ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
709: ZEND_ARG_INFO(0, function_name)
710: ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
711: ZEND_END_ARG_INFO()
712:
713: ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2)
714: ZEND_ARG_INFO(0, method_name)
715: ZEND_ARG_INFO(1, object)
716: ZEND_ARG_INFO(0, parameter)
717: ZEND_ARG_INFO(0, ...)
718: ZEND_END_ARG_INFO()
719:
720: ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
721: ZEND_ARG_INFO(0, method_name)
722: ZEND_ARG_INFO(1, object)
723: ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
724: ZEND_END_ARG_INFO()
725:
726: ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
727: ZEND_ARG_INFO(0, function_name)
728: ZEND_ARG_INFO(0, parameter)
729: ZEND_ARG_INFO(0, ...)
730: ZEND_END_ARG_INFO()
731:
732: ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2)
733: ZEND_ARG_INFO(0, function_name)
734: ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
735: ZEND_END_ARG_INFO()
736:
737: ZEND_BEGIN_ARG_INFO(arginfo_register_shutdown_function, 0)
738: ZEND_ARG_INFO(0, function_name)
739: ZEND_END_ARG_INFO()
740:
741: ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1)
742: ZEND_ARG_INFO(0, file_name)
743: ZEND_ARG_INFO(0, return)
744: ZEND_END_ARG_INFO()
745:
746: ZEND_BEGIN_ARG_INFO(arginfo_php_strip_whitespace, 0)
747: ZEND_ARG_INFO(0, file_name)
748: ZEND_END_ARG_INFO()
749:
750: ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_string, 0, 0, 1)
751: ZEND_ARG_INFO(0, string)
752: ZEND_ARG_INFO(0, return)
753: ZEND_END_ARG_INFO()
754:
755: ZEND_BEGIN_ARG_INFO(arginfo_ini_get, 0)
756: ZEND_ARG_INFO(0, varname)
757: ZEND_END_ARG_INFO()
758:
759: ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0)
760: ZEND_ARG_INFO(0, extension)
761: ZEND_END_ARG_INFO()
762:
763: ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0)
764: ZEND_ARG_INFO(0, varname)
765: ZEND_ARG_INFO(0, newvalue)
766: ZEND_END_ARG_INFO()
767:
768: ZEND_BEGIN_ARG_INFO(arginfo_ini_restore, 0)
769: ZEND_ARG_INFO(0, varname)
770: ZEND_END_ARG_INFO()
771:
772: ZEND_BEGIN_ARG_INFO(arginfo_set_include_path, 0)
773: ZEND_ARG_INFO(0, new_include_path)
774: ZEND_END_ARG_INFO()
775:
776: ZEND_BEGIN_ARG_INFO(arginfo_get_include_path, 0)
777: ZEND_END_ARG_INFO()
778:
779: ZEND_BEGIN_ARG_INFO(arginfo_restore_include_path, 0)
780: ZEND_END_ARG_INFO()
781:
782: ZEND_BEGIN_ARG_INFO_EX(arginfo_print_r, 0, 0, 1)
783: ZEND_ARG_INFO(0, var)
784: ZEND_ARG_INFO(0, return)
785: ZEND_END_ARG_INFO()
786:
787: ZEND_BEGIN_ARG_INFO(arginfo_connection_aborted, 0)
788: ZEND_END_ARG_INFO()
789:
790: ZEND_BEGIN_ARG_INFO(arginfo_connection_status, 0)
791: ZEND_END_ARG_INFO()
792:
793: ZEND_BEGIN_ARG_INFO_EX(arginfo_ignore_user_abort, 0, 0, 0)
794: ZEND_ARG_INFO(0, value)
795: ZEND_END_ARG_INFO()
796:
797: #if HAVE_GETSERVBYNAME
798: ZEND_BEGIN_ARG_INFO(arginfo_getservbyname, 0)
799: ZEND_ARG_INFO(0, service)
800: ZEND_ARG_INFO(0, protocol)
801: ZEND_END_ARG_INFO()
802: #endif
803:
804: #if HAVE_GETSERVBYPORT
805: ZEND_BEGIN_ARG_INFO(arginfo_getservbyport, 0)
806: ZEND_ARG_INFO(0, port)
807: ZEND_ARG_INFO(0, protocol)
808: ZEND_END_ARG_INFO()
809: #endif
810:
811: #if HAVE_GETPROTOBYNAME
812: ZEND_BEGIN_ARG_INFO(arginfo_getprotobyname, 0)
813: ZEND_ARG_INFO(0, name)
814: ZEND_END_ARG_INFO()
815: #endif
816:
817: #if HAVE_GETPROTOBYNUMBER
818: ZEND_BEGIN_ARG_INFO(arginfo_getprotobynumber, 0)
819: ZEND_ARG_INFO(0, proto)
820: ZEND_END_ARG_INFO()
821: #endif
822:
823: ZEND_BEGIN_ARG_INFO_EX(arginfo_register_tick_function, 0, 0, 1)
824: ZEND_ARG_INFO(0, function_name)
825: ZEND_ARG_INFO(0, arg)
826: ZEND_ARG_INFO(0, ...)
827: ZEND_END_ARG_INFO()
828:
829: ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0)
830: ZEND_ARG_INFO(0, function_name)
831: ZEND_END_ARG_INFO()
832:
833: ZEND_BEGIN_ARG_INFO(arginfo_is_uploaded_file, 0)
834: ZEND_ARG_INFO(0, path)
835: ZEND_END_ARG_INFO()
836:
837: ZEND_BEGIN_ARG_INFO(arginfo_move_uploaded_file, 0)
838: ZEND_ARG_INFO(0, path)
839: ZEND_ARG_INFO(0, new_path)
840: ZEND_END_ARG_INFO()
841:
842: ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_file, 0, 0, 1)
843: ZEND_ARG_INFO(0, filename)
844: ZEND_ARG_INFO(0, process_sections)
845: ZEND_ARG_INFO(0, scanner_mode)
846: ZEND_END_ARG_INFO()
847:
848: ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_string, 0, 0, 1)
849: ZEND_ARG_INFO(0, ini_string)
850: ZEND_ARG_INFO(0, process_sections)
851: ZEND_ARG_INFO(0, scanner_mode)
852: ZEND_END_ARG_INFO()
853:
854: #if ZEND_DEBUG
855: ZEND_BEGIN_ARG_INFO(arginfo_config_get_hash, 0)
856: ZEND_END_ARG_INFO()
857: #endif
858:
859: ZEND_BEGIN_ARG_INFO_EX(arginfo_import_request_variables, 0, 0, 1)
860: ZEND_ARG_INFO(0, types)
861: ZEND_ARG_INFO(0, prefix)
862: ZEND_END_ARG_INFO()
863:
864: #ifdef HAVE_GETLOADAVG
865: ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0)
866: ZEND_END_ARG_INFO()
867: #endif
868: /* }}} */
869: /* {{{ assert.c */
870: ZEND_BEGIN_ARG_INFO(arginfo_assert, 0)
871: ZEND_ARG_INFO(0, assertion)
872: ZEND_END_ARG_INFO()
873:
874: ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1)
875: ZEND_ARG_INFO(0, what)
876: ZEND_ARG_INFO(0, value)
877: ZEND_END_ARG_INFO()
878: /* }}} */
879: /* {{{ base64.c */
880: ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0)
881: ZEND_ARG_INFO(0, str)
882: ZEND_END_ARG_INFO()
883:
884: ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
885: ZEND_ARG_INFO(0, str)
886: ZEND_ARG_INFO(0, strict)
887: ZEND_END_ARG_INFO()
888:
889: /* }}} */
890: /* {{{ browscap.c */
891: ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0)
892: ZEND_ARG_INFO(0, browser_name)
893: ZEND_ARG_INFO(0, return_array)
894: ZEND_END_ARG_INFO()
895: /* }}} */
896: /* {{{ crc32.c */
897: ZEND_BEGIN_ARG_INFO(arginfo_crc32, 0)
898: ZEND_ARG_INFO(0, str)
899: ZEND_END_ARG_INFO()
900:
901: /* }}} */
902: /* {{{ crypt.c */
903: #if HAVE_CRYPT
904: ZEND_BEGIN_ARG_INFO_EX(arginfo_crypt, 0, 0, 1)
905: ZEND_ARG_INFO(0, str)
906: ZEND_ARG_INFO(0, salt)
907: ZEND_END_ARG_INFO()
908: #endif
909: /* }}} */
910: /* {{{ cyr_convert.c */
911: ZEND_BEGIN_ARG_INFO(arginfo_convert_cyr_string, 0)
912: ZEND_ARG_INFO(0, str)
913: ZEND_ARG_INFO(0, from)
914: ZEND_ARG_INFO(0, to)
915: ZEND_END_ARG_INFO()
916:
917: /* }}} */
918: /* {{{ datetime.c */
919: #if HAVE_STRPTIME
920: ZEND_BEGIN_ARG_INFO(arginfo_strptime, 0)
921: ZEND_ARG_INFO(0, timestamp)
922: ZEND_ARG_INFO(0, format)
923: ZEND_END_ARG_INFO()
924: #endif
925: /* }}} */
926: /* {{{ dir.c */
927: ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1)
928: ZEND_ARG_INFO(0, path)
929: ZEND_ARG_INFO(0, context)
930: ZEND_END_ARG_INFO()
931:
932: ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 1)
933: ZEND_ARG_INFO(0, directory)
934: ZEND_ARG_INFO(0, context)
935: ZEND_END_ARG_INFO()
936:
937: ZEND_BEGIN_ARG_INFO_EX(arginfo_closedir, 0, 0, 0)
938: ZEND_ARG_INFO(0, dir_handle)
939: ZEND_END_ARG_INFO()
940:
941: #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
942: ZEND_BEGIN_ARG_INFO(arginfo_chroot, 0)
943: ZEND_ARG_INFO(0, directory)
944: ZEND_END_ARG_INFO()
945: #endif
946:
947: ZEND_BEGIN_ARG_INFO(arginfo_chdir, 0)
948: ZEND_ARG_INFO(0, directory)
949: ZEND_END_ARG_INFO()
950:
951: ZEND_BEGIN_ARG_INFO(arginfo_getcwd, 0)
952: ZEND_END_ARG_INFO()
953:
954: ZEND_BEGIN_ARG_INFO_EX(arginfo_rewinddir, 0, 0, 0)
955: ZEND_ARG_INFO(0, dir_handle)
956: ZEND_END_ARG_INFO()
957:
958: ZEND_BEGIN_ARG_INFO_EX(arginfo_readdir, 0, 0, 0)
959: ZEND_ARG_INFO(0, dir_handle)
960: ZEND_END_ARG_INFO()
961:
962: #ifdef HAVE_GLOB
963: ZEND_BEGIN_ARG_INFO_EX(arginfo_glob, 0, 0, 1)
964: ZEND_ARG_INFO(0, pattern)
965: ZEND_ARG_INFO(0, flags)
966: ZEND_END_ARG_INFO()
967: #endif
968:
969: ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1)
970: ZEND_ARG_INFO(0, dir)
971: ZEND_ARG_INFO(0, sorting_order)
972: ZEND_ARG_INFO(0, context)
973: ZEND_END_ARG_INFO()
974: /* }}} */
975: /* {{{ arginfo ext/standard/dl.c */
976: ZEND_BEGIN_ARG_INFO(arginfo_dl, 0)
977: ZEND_ARG_INFO(0, extension_filename)
978: ZEND_END_ARG_INFO()
979: /* }}} */
980: /* {{{ dns.c */
981: ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0)
982: ZEND_ARG_INFO(0, ip_address)
983: ZEND_END_ARG_INFO()
984:
985: ZEND_BEGIN_ARG_INFO(arginfo_gethostbyname, 0)
986: ZEND_ARG_INFO(0, hostname)
987: ZEND_END_ARG_INFO()
988:
989: ZEND_BEGIN_ARG_INFO(arginfo_gethostbynamel, 0)
990: ZEND_ARG_INFO(0, hostname)
991: ZEND_END_ARG_INFO()
992:
993: #ifdef HAVE_GETHOSTNAME
994: ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
995: ZEND_END_ARG_INFO()
996: #endif
997:
998: #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
999: ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
1000: ZEND_ARG_INFO(0, host)
1001: ZEND_ARG_INFO(0, type)
1002: ZEND_END_ARG_INFO()
1003:
1004: # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
1005: ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 1, 0, 1)
1006: ZEND_ARG_INFO(0, hostname)
1007: ZEND_ARG_INFO(0, type)
1008: ZEND_ARG_INFO(1, authns) /* ARRAY_INFO(1, authns, 1) */
1009: ZEND_ARG_INFO(1, addtl) /* ARRAY_INFO(1, addtl, 1) */
1010: ZEND_END_ARG_INFO()
1011:
1012: ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
1013: ZEND_ARG_INFO(0, hostname)
1014: ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */
1015: ZEND_ARG_INFO(1, weight) /* ARRAY_INFO(1, weight, 1) */
1016: ZEND_END_ARG_INFO()
1017: # endif
1018:
1019: #endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) */
1020: /* }}} */
1021:
1022: /* {{{ exec.c */
1023: ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1)
1024: ZEND_ARG_INFO(0, command)
1025: ZEND_ARG_INFO(1, output) /* ARRAY_INFO(1, output, 1) */
1026: ZEND_ARG_INFO(1, return_value)
1027: ZEND_END_ARG_INFO()
1028:
1029: ZEND_BEGIN_ARG_INFO_EX(arginfo_system, 0, 0, 1)
1030: ZEND_ARG_INFO(0, command)
1031: ZEND_ARG_INFO(1, return_value)
1032: ZEND_END_ARG_INFO()
1033:
1034: ZEND_BEGIN_ARG_INFO_EX(arginfo_passthru, 0, 0, 1)
1035: ZEND_ARG_INFO(0, command)
1036: ZEND_ARG_INFO(1, return_value)
1037: ZEND_END_ARG_INFO()
1038:
1039: ZEND_BEGIN_ARG_INFO(arginfo_escapeshellcmd, 0)
1040: ZEND_ARG_INFO(0, command)
1041: ZEND_END_ARG_INFO()
1042:
1043: ZEND_BEGIN_ARG_INFO(arginfo_escapeshellarg, 0)
1044: ZEND_ARG_INFO(0, arg)
1045: ZEND_END_ARG_INFO()
1046:
1047: ZEND_BEGIN_ARG_INFO(arginfo_shell_exec, 0)
1048: ZEND_ARG_INFO(0, cmd)
1049: ZEND_END_ARG_INFO()
1050:
1051: #ifdef HAVE_NICE
1052: ZEND_BEGIN_ARG_INFO(arginfo_proc_nice, 0)
1053: ZEND_ARG_INFO(0, priority)
1054: ZEND_END_ARG_INFO()
1055: #endif
1056: /* }}} */
1057: /* {{{ file.c */
1058: ZEND_BEGIN_ARG_INFO_EX(arginfo_flock, 0, 0, 2)
1059: ZEND_ARG_INFO(0, fp)
1060: ZEND_ARG_INFO(0, operation)
1061: ZEND_ARG_INFO(1, wouldblock)
1062: ZEND_END_ARG_INFO()
1063:
1064: ZEND_BEGIN_ARG_INFO_EX(arginfo_get_meta_tags, 0, 0, 1)
1065: ZEND_ARG_INFO(0, filename)
1066: ZEND_ARG_INFO(0, use_include_path)
1067: ZEND_END_ARG_INFO()
1068:
1069: ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1)
1070: ZEND_ARG_INFO(0, filename)
1071: ZEND_ARG_INFO(0, flags)
1072: ZEND_ARG_INFO(0, context)
1073: ZEND_ARG_INFO(0, offset)
1074: ZEND_ARG_INFO(0, maxlen)
1075: ZEND_END_ARG_INFO()
1076:
1077: ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2)
1078: ZEND_ARG_INFO(0, filename)
1079: ZEND_ARG_INFO(0, data)
1080: ZEND_ARG_INFO(0, flags)
1081: ZEND_ARG_INFO(0, context)
1082: ZEND_END_ARG_INFO()
1083:
1084: ZEND_BEGIN_ARG_INFO_EX(arginfo_file, 0, 0, 1)
1085: ZEND_ARG_INFO(0, filename)
1086: ZEND_ARG_INFO(0, flags)
1087: ZEND_ARG_INFO(0, context)
1088: ZEND_END_ARG_INFO()
1089:
1090: ZEND_BEGIN_ARG_INFO(arginfo_tempnam, 0)
1091: ZEND_ARG_INFO(0, dir)
1092: ZEND_ARG_INFO(0, prefix)
1093: ZEND_END_ARG_INFO()
1094:
1095: ZEND_BEGIN_ARG_INFO(arginfo_tmpfile, 0)
1096: ZEND_END_ARG_INFO()
1097:
1098: ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2)
1099: ZEND_ARG_INFO(0, filename)
1100: ZEND_ARG_INFO(0, mode)
1101: ZEND_ARG_INFO(0, use_include_path)
1102: ZEND_ARG_INFO(0, context)
1103: ZEND_END_ARG_INFO()
1104:
1105: ZEND_BEGIN_ARG_INFO(arginfo_fclose, 0)
1106: ZEND_ARG_INFO(0, fp)
1107: ZEND_END_ARG_INFO()
1108:
1109: ZEND_BEGIN_ARG_INFO(arginfo_popen, 0)
1110: ZEND_ARG_INFO(0, command)
1111: ZEND_ARG_INFO(0, mode)
1112: ZEND_END_ARG_INFO()
1113:
1114: ZEND_BEGIN_ARG_INFO(arginfo_pclose, 0)
1115: ZEND_ARG_INFO(0, fp)
1116: ZEND_END_ARG_INFO()
1117:
1118: ZEND_BEGIN_ARG_INFO(arginfo_feof, 0)
1119: ZEND_ARG_INFO(0, fp)
1120: ZEND_END_ARG_INFO()
1121:
1122: ZEND_BEGIN_ARG_INFO_EX(arginfo_fgets, 0, 0, 1)
1123: ZEND_ARG_INFO(0, fp)
1124: ZEND_ARG_INFO(0, length)
1125: ZEND_END_ARG_INFO()
1126:
1127: ZEND_BEGIN_ARG_INFO(arginfo_fgetc, 0)
1128: ZEND_ARG_INFO(0, fp)
1129: ZEND_END_ARG_INFO()
1130:
1131: ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1)
1132: ZEND_ARG_INFO(0, fp)
1133: ZEND_ARG_INFO(0, length)
1134: ZEND_ARG_INFO(0, allowable_tags)
1135: ZEND_END_ARG_INFO()
1136:
1137: ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 1, 0, 2)
1138: ZEND_ARG_INFO(0, stream)
1139: ZEND_ARG_INFO(0, format)
1140: ZEND_ARG_INFO(1, ...)
1141: ZEND_END_ARG_INFO()
1142:
1143: ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2)
1144: ZEND_ARG_INFO(0, fp)
1145: ZEND_ARG_INFO(0, str)
1146: ZEND_ARG_INFO(0, length)
1147: ZEND_END_ARG_INFO()
1148:
1149: ZEND_BEGIN_ARG_INFO(arginfo_fflush, 0)
1150: ZEND_ARG_INFO(0, fp)
1151: ZEND_END_ARG_INFO()
1152:
1153: ZEND_BEGIN_ARG_INFO(arginfo_rewind, 0)
1154: ZEND_ARG_INFO(0, fp)
1155: ZEND_END_ARG_INFO()
1156:
1157: ZEND_BEGIN_ARG_INFO(arginfo_ftell, 0)
1158: ZEND_ARG_INFO(0, fp)
1159: ZEND_END_ARG_INFO()
1160:
1161: ZEND_BEGIN_ARG_INFO_EX(arginfo_fseek, 0, 0, 2)
1162: ZEND_ARG_INFO(0, fp)
1163: ZEND_ARG_INFO(0, offset)
1164: ZEND_ARG_INFO(0, whence)
1165: ZEND_END_ARG_INFO()
1166:
1167: ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1)
1168: ZEND_ARG_INFO(0, pathname)
1169: ZEND_ARG_INFO(0, mode)
1170: ZEND_ARG_INFO(0, recursive)
1171: ZEND_ARG_INFO(0, context)
1172: ZEND_END_ARG_INFO()
1173:
1174: ZEND_BEGIN_ARG_INFO_EX(arginfo_rmdir, 0, 0, 1)
1175: ZEND_ARG_INFO(0, dirname)
1176: ZEND_ARG_INFO(0, context)
1177: ZEND_END_ARG_INFO()
1178:
1179: ZEND_BEGIN_ARG_INFO_EX(arginfo_readfile, 0, 0, 1)
1180: ZEND_ARG_INFO(0, filename)
1181: ZEND_ARG_INFO(0, flags)
1182: ZEND_ARG_INFO(0, context)
1183: ZEND_END_ARG_INFO()
1184:
1185: ZEND_BEGIN_ARG_INFO_EX(arginfo_umask, 0, 0, 0)
1186: ZEND_ARG_INFO(0, mask)
1187: ZEND_END_ARG_INFO()
1188:
1189: ZEND_BEGIN_ARG_INFO(arginfo_fpassthru, 0)
1190: ZEND_ARG_INFO(0, fp)
1191: ZEND_END_ARG_INFO()
1192:
1193: ZEND_BEGIN_ARG_INFO_EX(arginfo_rename, 0, 0, 2)
1194: ZEND_ARG_INFO(0, old_name)
1195: ZEND_ARG_INFO(0, new_name)
1196: ZEND_ARG_INFO(0, context)
1197: ZEND_END_ARG_INFO()
1198:
1199: ZEND_BEGIN_ARG_INFO_EX(arginfo_unlink, 0, 0, 1)
1200: ZEND_ARG_INFO(0, filename)
1201: ZEND_ARG_INFO(0, context)
1202: ZEND_END_ARG_INFO()
1203:
1204: ZEND_BEGIN_ARG_INFO(arginfo_ftruncate, 0)
1205: ZEND_ARG_INFO(0, fp)
1206: ZEND_ARG_INFO(0, size)
1207: ZEND_END_ARG_INFO()
1208:
1209: ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0)
1210: ZEND_ARG_INFO(0, fp)
1211: ZEND_END_ARG_INFO()
1212:
1213: ZEND_BEGIN_ARG_INFO_EX(arginfo_copy, 0, 0, 2)
1214: ZEND_ARG_INFO(0, source_file)
1215: ZEND_ARG_INFO(0, destination_file)
1216: ZEND_ARG_INFO(0, context)
1217: ZEND_END_ARG_INFO()
1218:
1219: ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)
1220: ZEND_ARG_INFO(0, fp)
1221: ZEND_ARG_INFO(0, length)
1222: ZEND_END_ARG_INFO()
1223:
1224: ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2)
1225: ZEND_ARG_INFO(0, fp)
1226: ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 1) */
1227: ZEND_ARG_INFO(0, delimiter)
1228: ZEND_ARG_INFO(0, enclosure)
1229: ZEND_END_ARG_INFO()
1230:
1231: ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
1232: ZEND_ARG_INFO(0, fp)
1233: ZEND_ARG_INFO(0, length)
1234: ZEND_ARG_INFO(0, delimiter)
1235: ZEND_ARG_INFO(0, enclosure)
1236: ZEND_ARG_INFO(0, escape)
1237: ZEND_END_ARG_INFO()
1238:
1239: #if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
1240: ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
1241: ZEND_ARG_INFO(0, path)
1242: ZEND_END_ARG_INFO()
1243: #endif
1244:
1245: #ifdef HAVE_FNMATCH
1246: ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2)
1247: ZEND_ARG_INFO(0, pattern)
1248: ZEND_ARG_INFO(0, filename)
1249: ZEND_ARG_INFO(0, flags)
1250: ZEND_END_ARG_INFO()
1251: #endif
1252:
1253: ZEND_BEGIN_ARG_INFO(arginfo_sys_get_temp_dir, 0)
1254: ZEND_END_ARG_INFO()
1255: /* }}} */
1256: /* {{{ filestat.c */
1257: ZEND_BEGIN_ARG_INFO(arginfo_disk_total_space, 0)
1258: ZEND_ARG_INFO(0, path)
1259: ZEND_END_ARG_INFO()
1260:
1261: ZEND_BEGIN_ARG_INFO(arginfo_disk_free_space, 0)
1262: ZEND_ARG_INFO(0, path)
1263: ZEND_END_ARG_INFO()
1264:
1265: #ifndef NETWARE
1266: ZEND_BEGIN_ARG_INFO(arginfo_chgrp, 0)
1267: ZEND_ARG_INFO(0, filename)
1268: ZEND_ARG_INFO(0, group)
1269: ZEND_END_ARG_INFO()
1270:
1271: ZEND_BEGIN_ARG_INFO(arginfo_chown, 0)
1272: ZEND_ARG_INFO(0, filename)
1273: ZEND_ARG_INFO(0, user)
1274: ZEND_END_ARG_INFO()
1275: #endif
1276:
1277: #if HAVE_LCHOWN
1278: ZEND_BEGIN_ARG_INFO(arginfo_lchgrp, 0)
1279: ZEND_ARG_INFO(0, filename)
1280: ZEND_ARG_INFO(0, group)
1281: ZEND_END_ARG_INFO()
1282:
1283: ZEND_BEGIN_ARG_INFO(arginfo_lchown, 0)
1284: ZEND_ARG_INFO(0, filename)
1285: ZEND_ARG_INFO(0, user)
1286: ZEND_END_ARG_INFO()
1287: #endif
1288:
1289: ZEND_BEGIN_ARG_INFO(arginfo_chmod, 0)
1290: ZEND_ARG_INFO(0, filename)
1291: ZEND_ARG_INFO(0, mode)
1292: ZEND_END_ARG_INFO()
1293:
1294: #if HAVE_UTIME
1295: ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1)
1296: ZEND_ARG_INFO(0, filename)
1297: ZEND_ARG_INFO(0, time)
1298: ZEND_ARG_INFO(0, atime)
1299: ZEND_END_ARG_INFO()
1300: #endif
1301:
1302: ZEND_BEGIN_ARG_INFO_EX(arginfo_clearstatcache, 0, 0, 0)
1303: ZEND_ARG_INFO(0, clear_realpath_cache)
1304: ZEND_ARG_INFO(0, filename)
1305: ZEND_END_ARG_INFO()
1306:
1307: ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_size, 0)
1308: ZEND_END_ARG_INFO()
1309:
1310: ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_get, 0)
1311: ZEND_END_ARG_INFO()
1312:
1313: ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0)
1314: ZEND_ARG_INFO(0, filename)
1315: ZEND_END_ARG_INFO()
1316:
1317: ZEND_BEGIN_ARG_INFO(arginfo_fileinode, 0)
1318: ZEND_ARG_INFO(0, filename)
1319: ZEND_END_ARG_INFO()
1320:
1321: ZEND_BEGIN_ARG_INFO(arginfo_filesize, 0)
1322: ZEND_ARG_INFO(0, filename)
1323: ZEND_END_ARG_INFO()
1324:
1325: ZEND_BEGIN_ARG_INFO(arginfo_fileowner, 0)
1326: ZEND_ARG_INFO(0, filename)
1327: ZEND_END_ARG_INFO()
1328:
1329: ZEND_BEGIN_ARG_INFO(arginfo_filegroup, 0)
1330: ZEND_ARG_INFO(0, filename)
1331: ZEND_END_ARG_INFO()
1332:
1333: ZEND_BEGIN_ARG_INFO(arginfo_fileatime, 0)
1334: ZEND_ARG_INFO(0, filename)
1335: ZEND_END_ARG_INFO()
1336:
1337: ZEND_BEGIN_ARG_INFO(arginfo_filemtime, 0)
1338: ZEND_ARG_INFO(0, filename)
1339: ZEND_END_ARG_INFO()
1340:
1341: ZEND_BEGIN_ARG_INFO(arginfo_filectime, 0)
1342: ZEND_ARG_INFO(0, filename)
1343: ZEND_END_ARG_INFO()
1344:
1345: ZEND_BEGIN_ARG_INFO(arginfo_filetype, 0)
1346: ZEND_ARG_INFO(0, filename)
1347: ZEND_END_ARG_INFO()
1348:
1349: ZEND_BEGIN_ARG_INFO(arginfo_is_writable, 0)
1350: ZEND_ARG_INFO(0, filename)
1351: ZEND_END_ARG_INFO()
1352:
1353: ZEND_BEGIN_ARG_INFO(arginfo_is_readable, 0)
1354: ZEND_ARG_INFO(0, filename)
1355: ZEND_END_ARG_INFO()
1356:
1357: ZEND_BEGIN_ARG_INFO(arginfo_is_executable, 0)
1358: ZEND_ARG_INFO(0, filename)
1359: ZEND_END_ARG_INFO()
1360:
1361: ZEND_BEGIN_ARG_INFO(arginfo_is_file, 0)
1362: ZEND_ARG_INFO(0, filename)
1363: ZEND_END_ARG_INFO()
1364:
1365: ZEND_BEGIN_ARG_INFO(arginfo_is_dir, 0)
1366: ZEND_ARG_INFO(0, filename)
1367: ZEND_END_ARG_INFO()
1368:
1369: ZEND_BEGIN_ARG_INFO(arginfo_is_link, 0)
1370: ZEND_ARG_INFO(0, filename)
1371: ZEND_END_ARG_INFO()
1372:
1373: ZEND_BEGIN_ARG_INFO(arginfo_file_exists, 0)
1374: ZEND_ARG_INFO(0, filename)
1375: ZEND_END_ARG_INFO()
1376:
1377: ZEND_BEGIN_ARG_INFO(arginfo_lstat, 0)
1378: ZEND_ARG_INFO(0, filename)
1379: ZEND_END_ARG_INFO()
1380:
1381: ZEND_BEGIN_ARG_INFO(arginfo_stat, 0)
1382: ZEND_ARG_INFO(0, filename)
1383: ZEND_END_ARG_INFO()
1384: /* }}} */
1385: /* {{{ formatted_print.c */
1386: ZEND_BEGIN_ARG_INFO_EX(arginfo_sprintf, 0, 0, 2)
1387: ZEND_ARG_INFO(0, format)
1388: ZEND_ARG_INFO(0, arg1)
1389: ZEND_ARG_INFO(0, ...)
1390: ZEND_END_ARG_INFO()
1391:
1392: ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0)
1393: ZEND_ARG_INFO(0, format)
1394: ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
1395: ZEND_END_ARG_INFO()
1396:
1397: ZEND_BEGIN_ARG_INFO_EX(arginfo_printf, 0, 0, 1)
1398: ZEND_ARG_INFO(0, format)
1399: ZEND_ARG_INFO(0, arg1)
1400: ZEND_ARG_INFO(0, ...)
1401: ZEND_END_ARG_INFO()
1402:
1403: ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0)
1404: ZEND_ARG_INFO(0, format)
1405: ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
1406: ZEND_END_ARG_INFO()
1407:
1408: ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2)
1409: ZEND_ARG_INFO(0, stream)
1410: ZEND_ARG_INFO(0, format)
1411: ZEND_ARG_INFO(0, arg1)
1412: ZEND_ARG_INFO(0, ...)
1413: ZEND_END_ARG_INFO()
1414:
1415: ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
1416: ZEND_ARG_INFO(0, stream)
1417: ZEND_ARG_INFO(0, format)
1418: ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
1419: ZEND_END_ARG_INFO()
1420: /* }}} */
1421: /* {{{ fsock.c */
1422: ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 2)
1423: ZEND_ARG_INFO(0, hostname)
1424: ZEND_ARG_INFO(0, port)
1425: ZEND_ARG_INFO(1, errno)
1426: ZEND_ARG_INFO(1, errstr)
1427: ZEND_ARG_INFO(0, timeout)
1428: ZEND_END_ARG_INFO()
1429:
1430: ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 2)
1431: ZEND_ARG_INFO(0, hostname)
1432: ZEND_ARG_INFO(0, port)
1433: ZEND_ARG_INFO(1, errno)
1434: ZEND_ARG_INFO(1, errstr)
1435: ZEND_ARG_INFO(0, timeout)
1436: ZEND_END_ARG_INFO()
1437: /* }}} */
1438: /* {{{ ftok.c */
1439: #if HAVE_FTOK
1440: ZEND_BEGIN_ARG_INFO(arginfo_ftok, 0)
1441: ZEND_ARG_INFO(0, pathname)
1442: ZEND_ARG_INFO(0, proj)
1443: ZEND_END_ARG_INFO()
1444: #endif
1445: /* }}} */
1446: /* {{{ head.c */
1447: ZEND_BEGIN_ARG_INFO_EX(arginfo_header, 0, 0, 1)
1448: ZEND_ARG_INFO(0, header)
1449: ZEND_ARG_INFO(0, replace)
1450: ZEND_ARG_INFO(0, http_response_code)
1451: ZEND_END_ARG_INFO()
1452:
1453: ZEND_BEGIN_ARG_INFO_EX(arginfo_header_remove, 0, 0, 0)
1454: ZEND_ARG_INFO(0, name)
1455: ZEND_END_ARG_INFO()
1456:
1457: ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1)
1458: ZEND_ARG_INFO(0, name)
1459: ZEND_ARG_INFO(0, value)
1460: ZEND_ARG_INFO(0, expires)
1461: ZEND_ARG_INFO(0, path)
1462: ZEND_ARG_INFO(0, domain)
1463: ZEND_ARG_INFO(0, secure)
1464: ZEND_END_ARG_INFO()
1465:
1466: ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1)
1467: ZEND_ARG_INFO(0, name)
1468: ZEND_ARG_INFO(0, value)
1469: ZEND_ARG_INFO(0, expires)
1470: ZEND_ARG_INFO(0, path)
1471: ZEND_ARG_INFO(0, domain)
1472: ZEND_ARG_INFO(0, secure)
1473: ZEND_END_ARG_INFO()
1474:
1475: ZEND_BEGIN_ARG_INFO_EX(arginfo_headers_sent, 0, 0, 0)
1476: ZEND_ARG_INFO(1, file)
1477: ZEND_ARG_INFO(1, line)
1478: ZEND_END_ARG_INFO()
1479:
1480: ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0)
1481: ZEND_END_ARG_INFO()
1482: /* }}} */
1483: /* {{{ html.c */
1484: ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
1485: ZEND_ARG_INFO(0, string)
1486: ZEND_ARG_INFO(0, quote_style)
1487: ZEND_ARG_INFO(0, charset)
1488: ZEND_ARG_INFO(0, double_encode)
1489: ZEND_END_ARG_INFO()
1490:
1491: ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars_decode, 0, 0, 1)
1492: ZEND_ARG_INFO(0, string)
1493: ZEND_ARG_INFO(0, quote_style)
1494: ZEND_END_ARG_INFO()
1495:
1496: ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1)
1497: ZEND_ARG_INFO(0, string)
1498: ZEND_ARG_INFO(0, quote_style)
1499: ZEND_ARG_INFO(0, charset)
1500: ZEND_END_ARG_INFO()
1501:
1502: ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1)
1503: ZEND_ARG_INFO(0, string)
1504: ZEND_ARG_INFO(0, quote_style)
1505: ZEND_ARG_INFO(0, charset)
1506: ZEND_ARG_INFO(0, double_encode)
1507: ZEND_END_ARG_INFO()
1508:
1509: ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0)
1510: ZEND_ARG_INFO(0, table)
1511: ZEND_ARG_INFO(0, quote_style)
1512: ZEND_END_ARG_INFO()
1513:
1514: /* }}} */
1515: /* {{{ http.c */
1516: ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1)
1517: ZEND_ARG_INFO(0, formdata)
1518: ZEND_ARG_INFO(0, prefix)
1519: ZEND_ARG_INFO(0, arg_separator)
1520: ZEND_END_ARG_INFO()
1521: /* }}} */
1522: /* {{{ image.c */
1523: ZEND_BEGIN_ARG_INFO(arginfo_image_type_to_mime_type, 0)
1524: ZEND_ARG_INFO(0, imagetype)
1525: ZEND_END_ARG_INFO()
1526:
1527: ZEND_BEGIN_ARG_INFO_EX(arginfo_image_type_to_extension, 0, 0, 1)
1528: ZEND_ARG_INFO(0, imagetype)
1529: ZEND_ARG_INFO(0, include_dot)
1530: ZEND_END_ARG_INFO()
1531:
1532: ZEND_BEGIN_ARG_INFO_EX(arginfo_getimagesize, 0, 0, 1)
1533: ZEND_ARG_INFO(0, imagefile)
1534: ZEND_ARG_INFO(1, info) /* ARRAY_INFO(1, info, 1) */
1535: ZEND_END_ARG_INFO()
1536: /* }}} */
1537: /* {{{ info.c */
1538: ZEND_BEGIN_ARG_INFO_EX(arginfo_phpinfo, 0, 0, 0)
1539: ZEND_ARG_INFO(0, what)
1540: ZEND_END_ARG_INFO()
1541:
1542: ZEND_BEGIN_ARG_INFO_EX(arginfo_phpversion, 0, 0, 0)
1543: ZEND_ARG_INFO(0, extension)
1544: ZEND_END_ARG_INFO()
1545:
1546: ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
1547: ZEND_ARG_INFO(0, flag)
1548: ZEND_END_ARG_INFO()
1549:
1550: ZEND_BEGIN_ARG_INFO(arginfo_php_logo_guid, 0)
1551: ZEND_END_ARG_INFO()
1552:
1553: ZEND_BEGIN_ARG_INFO(arginfo_php_real_logo_guid, 0)
1554: ZEND_END_ARG_INFO()
1555:
1556: ZEND_BEGIN_ARG_INFO(arginfo_php_egg_logo_guid, 0)
1557: ZEND_END_ARG_INFO()
1558:
1559: ZEND_BEGIN_ARG_INFO(arginfo_zend_logo_guid, 0)
1560: ZEND_END_ARG_INFO()
1561:
1562: ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
1563: ZEND_END_ARG_INFO()
1564:
1565: ZEND_BEGIN_ARG_INFO(arginfo_php_uname, 0)
1566: ZEND_END_ARG_INFO()
1567:
1568: ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0)
1569: ZEND_END_ARG_INFO()
1570:
1571: ZEND_BEGIN_ARG_INFO(arginfo_php_ini_loaded_file, 0)
1572: ZEND_END_ARG_INFO()
1573: /* }}} */
1574: /* {{{ iptc.c */
1575: ZEND_BEGIN_ARG_INFO_EX(arginfo_iptcembed, 0, 0, 2)
1576: ZEND_ARG_INFO(0, iptcdata)
1577: ZEND_ARG_INFO(0, jpeg_file_name)
1578: ZEND_ARG_INFO(0, spool)
1579: ZEND_END_ARG_INFO()
1580:
1581: ZEND_BEGIN_ARG_INFO(arginfo_iptcparse, 0)
1582: ZEND_ARG_INFO(0, iptcdata)
1583: ZEND_END_ARG_INFO()
1584: /* }}} */
1585: /* {{{ lcg.c */
1586: ZEND_BEGIN_ARG_INFO(arginfo_lcg_value, 0)
1587: ZEND_END_ARG_INFO()
1588: /* }}} */
1589: /* {{{ levenshtein.c */
1590: ZEND_BEGIN_ARG_INFO(arginfo_levenshtein, 0)
1591: ZEND_ARG_INFO(0, str1)
1592: ZEND_ARG_INFO(0, str2)
1593: ZEND_ARG_INFO(0, cost_ins)
1594: ZEND_ARG_INFO(0, cost_rep)
1595: ZEND_ARG_INFO(0, cost_del)
1596: ZEND_END_ARG_INFO()
1597: /* }}} */
1598: /* {{{ link.c */
1599: #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
1600: ZEND_BEGIN_ARG_INFO(arginfo_readlink, 0)
1601: ZEND_ARG_INFO(0, filename)
1602: ZEND_END_ARG_INFO()
1603:
1604: ZEND_BEGIN_ARG_INFO(arginfo_linkinfo, 0)
1605: ZEND_ARG_INFO(0, filename)
1606: ZEND_END_ARG_INFO()
1607:
1608: ZEND_BEGIN_ARG_INFO(arginfo_symlink, 0)
1609: ZEND_ARG_INFO(0, target)
1610: ZEND_ARG_INFO(0, link)
1611: ZEND_END_ARG_INFO()
1612:
1613: ZEND_BEGIN_ARG_INFO(arginfo_link, 0)
1614: ZEND_ARG_INFO(0, target)
1615: ZEND_ARG_INFO(0, link)
1616: ZEND_END_ARG_INFO()
1617: #endif
1618: /* }}} */
1619: /* {{{ mail.c */
1620: ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0)
1621: ZEND_ARG_INFO(0, addr)
1622: ZEND_END_ARG_INFO()
1623:
1624: ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3)
1625: ZEND_ARG_INFO(0, to)
1626: ZEND_ARG_INFO(0, subject)
1627: ZEND_ARG_INFO(0, message)
1628: ZEND_ARG_INFO(0, additional_headers)
1629: ZEND_ARG_INFO(0, additional_parameters)
1630: ZEND_END_ARG_INFO()
1631: /* }}} */
1632: /* {{{ math.c */
1633: ZEND_BEGIN_ARG_INFO(arginfo_abs, 0)
1634: ZEND_ARG_INFO(0, number)
1635: ZEND_END_ARG_INFO()
1636:
1637: ZEND_BEGIN_ARG_INFO(arginfo_ceil, 0)
1638: ZEND_ARG_INFO(0, number)
1639: ZEND_END_ARG_INFO()
1640:
1641: ZEND_BEGIN_ARG_INFO(arginfo_floor, 0)
1642: ZEND_ARG_INFO(0, number)
1643: ZEND_END_ARG_INFO()
1644:
1645: ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1)
1646: ZEND_ARG_INFO(0, number)
1647: ZEND_ARG_INFO(0, precision)
1648: ZEND_ARG_INFO(0, mode)
1649: ZEND_END_ARG_INFO()
1650:
1651: ZEND_BEGIN_ARG_INFO(arginfo_sin, 0)
1652: ZEND_ARG_INFO(0, number)
1653: ZEND_END_ARG_INFO()
1654:
1655: ZEND_BEGIN_ARG_INFO(arginfo_cos, 0)
1656: ZEND_ARG_INFO(0, number)
1657: ZEND_END_ARG_INFO()
1658:
1659: ZEND_BEGIN_ARG_INFO(arginfo_tan, 0)
1660: ZEND_ARG_INFO(0, number)
1661: ZEND_END_ARG_INFO()
1662:
1663: ZEND_BEGIN_ARG_INFO(arginfo_asin, 0)
1664: ZEND_ARG_INFO(0, number)
1665: ZEND_END_ARG_INFO()
1666:
1667: ZEND_BEGIN_ARG_INFO(arginfo_acos, 0)
1668: ZEND_ARG_INFO(0, number)
1669: ZEND_END_ARG_INFO()
1670:
1671: ZEND_BEGIN_ARG_INFO(arginfo_atan, 0)
1672: ZEND_ARG_INFO(0, number)
1673: ZEND_END_ARG_INFO()
1674:
1675: ZEND_BEGIN_ARG_INFO(arginfo_atan2, 0)
1676: ZEND_ARG_INFO(0, y)
1677: ZEND_ARG_INFO(0, x)
1678: ZEND_END_ARG_INFO()
1679:
1680: ZEND_BEGIN_ARG_INFO(arginfo_sinh, 0)
1681: ZEND_ARG_INFO(0, number)
1682: ZEND_END_ARG_INFO()
1683:
1684: ZEND_BEGIN_ARG_INFO(arginfo_cosh, 0)
1685: ZEND_ARG_INFO(0, number)
1686: ZEND_END_ARG_INFO()
1687:
1688: ZEND_BEGIN_ARG_INFO(arginfo_tanh, 0)
1689: ZEND_ARG_INFO(0, number)
1690: ZEND_END_ARG_INFO()
1691:
1692: ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0)
1693: ZEND_ARG_INFO(0, number)
1694: ZEND_END_ARG_INFO()
1695:
1696: ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0)
1697: ZEND_ARG_INFO(0, number)
1698: ZEND_END_ARG_INFO()
1699:
1700: ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0)
1701: ZEND_ARG_INFO(0, number)
1702: ZEND_END_ARG_INFO()
1703:
1704: ZEND_BEGIN_ARG_INFO(arginfo_pi, 0)
1705: ZEND_END_ARG_INFO()
1706:
1707: ZEND_BEGIN_ARG_INFO(arginfo_is_finite, 0)
1708: ZEND_ARG_INFO(0, val)
1709: ZEND_END_ARG_INFO()
1710:
1711: ZEND_BEGIN_ARG_INFO(arginfo_is_infinite, 0)
1712: ZEND_ARG_INFO(0, val)
1713: ZEND_END_ARG_INFO()
1714:
1715: ZEND_BEGIN_ARG_INFO(arginfo_is_nan, 0)
1716: ZEND_ARG_INFO(0, val)
1717: ZEND_END_ARG_INFO()
1718:
1719: ZEND_BEGIN_ARG_INFO(arginfo_pow, 0)
1720: ZEND_ARG_INFO(0, base)
1721: ZEND_ARG_INFO(0, exponent)
1722: ZEND_END_ARG_INFO()
1723:
1724: ZEND_BEGIN_ARG_INFO(arginfo_exp, 0)
1725: ZEND_ARG_INFO(0, number)
1726: ZEND_END_ARG_INFO()
1727:
1728: ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0)
1729: ZEND_ARG_INFO(0, number)
1730: ZEND_END_ARG_INFO()
1731:
1732: ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0)
1733: ZEND_ARG_INFO(0, number)
1734: ZEND_END_ARG_INFO()
1735:
1736: ZEND_BEGIN_ARG_INFO_EX(arginfo_log, 0, 0, 1)
1737: ZEND_ARG_INFO(0, number)
1738: ZEND_ARG_INFO(0, base)
1739: ZEND_END_ARG_INFO()
1740:
1741: ZEND_BEGIN_ARG_INFO(arginfo_log10, 0)
1742: ZEND_ARG_INFO(0, number)
1743: ZEND_END_ARG_INFO()
1744:
1745: ZEND_BEGIN_ARG_INFO(arginfo_sqrt, 0)
1746: ZEND_ARG_INFO(0, number)
1747: ZEND_END_ARG_INFO()
1748:
1749: ZEND_BEGIN_ARG_INFO(arginfo_hypot, 0)
1750: ZEND_ARG_INFO(0, num1)
1751: ZEND_ARG_INFO(0, num2)
1752: ZEND_END_ARG_INFO()
1753:
1754: ZEND_BEGIN_ARG_INFO(arginfo_deg2rad, 0)
1755: ZEND_ARG_INFO(0, number)
1756: ZEND_END_ARG_INFO()
1757:
1758: ZEND_BEGIN_ARG_INFO(arginfo_rad2deg, 0)
1759: ZEND_ARG_INFO(0, number)
1760: ZEND_END_ARG_INFO()
1761:
1762: ZEND_BEGIN_ARG_INFO(arginfo_bindec, 0)
1763: ZEND_ARG_INFO(0, binary_number)
1764: ZEND_END_ARG_INFO()
1765:
1766: ZEND_BEGIN_ARG_INFO(arginfo_hexdec, 0)
1767: ZEND_ARG_INFO(0, hexadecimal_number)
1768: ZEND_END_ARG_INFO()
1769:
1770: ZEND_BEGIN_ARG_INFO(arginfo_octdec, 0)
1771: ZEND_ARG_INFO(0, octal_number)
1772: ZEND_END_ARG_INFO()
1773:
1774: ZEND_BEGIN_ARG_INFO(arginfo_decbin, 0)
1775: ZEND_ARG_INFO(0, decimal_number)
1776: ZEND_END_ARG_INFO()
1777:
1778: ZEND_BEGIN_ARG_INFO(arginfo_decoct, 0)
1779: ZEND_ARG_INFO(0, decimal_number)
1780: ZEND_END_ARG_INFO()
1781:
1782: ZEND_BEGIN_ARG_INFO(arginfo_dechex, 0)
1783: ZEND_ARG_INFO(0, decimal_number)
1784: ZEND_END_ARG_INFO()
1785:
1786: ZEND_BEGIN_ARG_INFO(arginfo_base_convert, 0)
1787: ZEND_ARG_INFO(0, number)
1788: ZEND_ARG_INFO(0, frombase)
1789: ZEND_ARG_INFO(0, tobase)
1790: ZEND_END_ARG_INFO()
1791:
1792: ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1)
1793: ZEND_ARG_INFO(0, number)
1794: ZEND_ARG_INFO(0, num_decimal_places)
1795: ZEND_ARG_INFO(0, dec_seperator)
1796: ZEND_ARG_INFO(0, thousands_seperator)
1797: ZEND_END_ARG_INFO()
1798:
1799: ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0)
1800: ZEND_ARG_INFO(0, x)
1801: ZEND_ARG_INFO(0, y)
1802: ZEND_END_ARG_INFO()
1803: /* }}} */
1804: /* {{{ md5.c */
1805: ZEND_BEGIN_ARG_INFO_EX(arginfo_md5, 0, 0, 1)
1806: ZEND_ARG_INFO(0, str)
1807: ZEND_ARG_INFO(0, raw_output)
1808: ZEND_END_ARG_INFO()
1809:
1810: ZEND_BEGIN_ARG_INFO_EX(arginfo_md5_file, 0, 0, 1)
1811: ZEND_ARG_INFO(0, filename)
1812: ZEND_ARG_INFO(0, raw_output)
1813: ZEND_END_ARG_INFO()
1814: /* }}} */
1815: /* {{{ metaphone.c */
1816: ZEND_BEGIN_ARG_INFO_EX(arginfo_metaphone, 0, 0, 1)
1817: ZEND_ARG_INFO(0, text)
1818: ZEND_ARG_INFO(0, phones)
1819: ZEND_END_ARG_INFO()
1820: /* }}} */
1821: /* {{{ microtime.c */
1822: #ifdef HAVE_GETTIMEOFDAY
1823: ZEND_BEGIN_ARG_INFO_EX(arginfo_microtime, 0, 0, 0)
1824: ZEND_ARG_INFO(0, get_as_float)
1825: ZEND_END_ARG_INFO()
1826:
1827: ZEND_BEGIN_ARG_INFO_EX(arginfo_gettimeofday, 0, 0, 0)
1828: ZEND_ARG_INFO(0, get_as_float)
1829: ZEND_END_ARG_INFO()
1830: #endif
1831:
1832: #ifdef HAVE_GETRUSAGE
1833: ZEND_BEGIN_ARG_INFO_EX(arginfo_getrusage, 0, 0, 0)
1834: ZEND_ARG_INFO(0, who)
1835: ZEND_END_ARG_INFO()
1836: #endif
1837: /* }}} */
1838: /* {{{ pack.c */
1839: ZEND_BEGIN_ARG_INFO_EX(arginfo_pack, 0, 0, 2)
1840: ZEND_ARG_INFO(0, format)
1841: ZEND_ARG_INFO(0, arg1)
1842: ZEND_ARG_INFO(0, ...)
1843: ZEND_END_ARG_INFO()
1844:
1845: ZEND_BEGIN_ARG_INFO(arginfo_unpack, 0)
1846: ZEND_ARG_INFO(0, format)
1847: ZEND_ARG_INFO(0, input)
1848: ZEND_END_ARG_INFO()
1849: /* }}} */
1850: /* {{{ pageinfo.c */
1851: ZEND_BEGIN_ARG_INFO(arginfo_getmyuid, 0)
1852: ZEND_END_ARG_INFO()
1853:
1854: ZEND_BEGIN_ARG_INFO(arginfo_getmygid, 0)
1855: ZEND_END_ARG_INFO()
1856:
1857: ZEND_BEGIN_ARG_INFO(arginfo_getmypid, 0)
1858: ZEND_END_ARG_INFO()
1859:
1860: ZEND_BEGIN_ARG_INFO(arginfo_getmyinode, 0)
1861: ZEND_END_ARG_INFO()
1862:
1863: ZEND_BEGIN_ARG_INFO(arginfo_getlastmod, 0)
1864: ZEND_END_ARG_INFO()
1865: /* }}} */
1866: /* {{{ proc_open.c */
1867: #ifdef PHP_CAN_SUPPORT_PROC_OPEN
1868: ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_terminate, 0, 0, 1)
1869: ZEND_ARG_INFO(0, process)
1870: ZEND_ARG_INFO(0, signal)
1871: ZEND_END_ARG_INFO()
1872:
1873: ZEND_BEGIN_ARG_INFO(arginfo_proc_close, 0)
1874: ZEND_ARG_INFO(0, process)
1875: ZEND_END_ARG_INFO()
1876:
1877: ZEND_BEGIN_ARG_INFO(arginfo_proc_get_status, 0)
1878: ZEND_ARG_INFO(0, process)
1879: ZEND_END_ARG_INFO()
1880:
1881: ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3)
1882: ZEND_ARG_INFO(0, command)
1883: ZEND_ARG_INFO(0, descriptorspec) /* ARRAY_INFO(0, descriptorspec, 1) */
1884: ZEND_ARG_INFO(1, pipes) /* ARRAY_INFO(1, pipes, 1) */
1885: ZEND_ARG_INFO(0, cwd)
1886: ZEND_ARG_INFO(0, env) /* ARRAY_INFO(0, env, 1) */
1887: ZEND_ARG_INFO(0, other_options) /* ARRAY_INFO(0, other_options, 1) */
1888: ZEND_END_ARG_INFO()
1889: #endif
1890: /* }}} */
1891: /* {{{ quot_print.c */
1892: ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_decode, 0)
1893: ZEND_ARG_INFO(0, str)
1894: ZEND_END_ARG_INFO()
1895: /* }}} */
1896: /* {{{ quot_print.c */
1897: ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_encode, 0)
1898: ZEND_ARG_INFO(0, str)
1899: ZEND_END_ARG_INFO()
1900: /* }}} */
1901: /* {{{ rand.c */
1902: ZEND_BEGIN_ARG_INFO_EX(arginfo_srand, 0, 0, 0)
1903: ZEND_ARG_INFO(0, seed)
1904: ZEND_END_ARG_INFO()
1905:
1906: ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0)
1907: ZEND_ARG_INFO(0, seed)
1908: ZEND_END_ARG_INFO()
1909:
1910: ZEND_BEGIN_ARG_INFO_EX(arginfo_rand, 0, 0, 0)
1911: ZEND_ARG_INFO(0, min)
1912: ZEND_ARG_INFO(0, max)
1913: ZEND_END_ARG_INFO()
1914:
1915: ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
1916: ZEND_ARG_INFO(0, min)
1917: ZEND_ARG_INFO(0, max)
1918: ZEND_END_ARG_INFO()
1919:
1920: ZEND_BEGIN_ARG_INFO(arginfo_getrandmax, 0)
1921: ZEND_END_ARG_INFO()
1922:
1923: ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
1924: ZEND_END_ARG_INFO()
1925: /* }}} */
1926: /* {{{ sha1.c */
1927: ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1)
1928: ZEND_ARG_INFO(0, str)
1929: ZEND_ARG_INFO(0, raw_output)
1930: ZEND_END_ARG_INFO()
1931:
1932: ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1_file, 0, 0, 1)
1933: ZEND_ARG_INFO(0, filename)
1934: ZEND_ARG_INFO(0, raw_output)
1935: ZEND_END_ARG_INFO()
1936: /* }}} */
1937: /* {{{ soundex.c */
1938: ZEND_BEGIN_ARG_INFO(arginfo_soundex, 0)
1939: ZEND_ARG_INFO(0, str)
1940: ZEND_END_ARG_INFO()
1941: /* }}} */
1942: /* {{{ streamsfuncs.c */
1943: #if HAVE_SOCKETPAIR
1944: ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0)
1945: ZEND_ARG_INFO(0, domain)
1946: ZEND_ARG_INFO(0, type)
1947: ZEND_ARG_INFO(0, protocol)
1948: ZEND_END_ARG_INFO()
1949: #endif
1950:
1951: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1)
1952: ZEND_ARG_INFO(0, remoteaddress)
1953: ZEND_ARG_INFO(1, errcode)
1954: ZEND_ARG_INFO(1, errstring)
1955: ZEND_ARG_INFO(0, timeout)
1956: ZEND_ARG_INFO(0, flags)
1957: ZEND_ARG_INFO(0, context)
1958: ZEND_END_ARG_INFO()
1959:
1960: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1)
1961: ZEND_ARG_INFO(0, localaddress)
1962: ZEND_ARG_INFO(1, errcode)
1963: ZEND_ARG_INFO(1, errstring)
1964: ZEND_ARG_INFO(0, flags)
1965: ZEND_ARG_INFO(0, context)
1966: ZEND_END_ARG_INFO()
1967:
1968: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1)
1969: ZEND_ARG_INFO(0, serverstream)
1970: ZEND_ARG_INFO(0, timeout)
1971: ZEND_ARG_INFO(1, peername)
1972: ZEND_END_ARG_INFO()
1973:
1974: ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_get_name, 0)
1975: ZEND_ARG_INFO(0, stream)
1976: ZEND_ARG_INFO(0, want_peer)
1977: ZEND_END_ARG_INFO()
1978:
1979: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2)
1980: ZEND_ARG_INFO(0, stream)
1981: ZEND_ARG_INFO(0, data)
1982: ZEND_ARG_INFO(0, flags)
1983: ZEND_ARG_INFO(0, target_addr)
1984: ZEND_END_ARG_INFO()
1985:
1986: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2)
1987: ZEND_ARG_INFO(0, stream)
1988: ZEND_ARG_INFO(0, amount)
1989: ZEND_ARG_INFO(0, flags)
1990: ZEND_ARG_INFO(1, remote_addr)
1991: ZEND_END_ARG_INFO()
1992:
1993: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_contents, 0, 0, 1)
1994: ZEND_ARG_INFO(0, source)
1995: ZEND_ARG_INFO(0, maxlen)
1996: ZEND_ARG_INFO(0, offset)
1997: ZEND_END_ARG_INFO()
1998:
1999: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2)
2000: ZEND_ARG_INFO(0, source)
2001: ZEND_ARG_INFO(0, dest)
2002: ZEND_ARG_INFO(0, maxlen)
2003: ZEND_ARG_INFO(0, pos)
2004: ZEND_END_ARG_INFO()
2005:
2006: ZEND_BEGIN_ARG_INFO(arginfo_stream_get_meta_data, 0)
2007: ZEND_ARG_INFO(0, fp)
2008: ZEND_END_ARG_INFO()
2009:
2010: ZEND_BEGIN_ARG_INFO(arginfo_stream_get_transports, 0)
2011: ZEND_END_ARG_INFO()
2012:
2013: ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0)
2014: ZEND_END_ARG_INFO()
2015:
2016: ZEND_BEGIN_ARG_INFO(arginfo_stream_resolve_include_path, 0)
2017: ZEND_ARG_INFO(0, filename)
2018: ZEND_END_ARG_INFO()
2019:
2020: ZEND_BEGIN_ARG_INFO(arginfo_stream_is_local, 0)
2021: ZEND_ARG_INFO(0, stream)
2022: ZEND_END_ARG_INFO()
2023:
2024: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1)
2025: ZEND_ARG_INFO(0, stream)
2026: ZEND_END_ARG_INFO()
2027:
2028: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4)
2029: ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */
2030: ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */
2031: ZEND_ARG_INFO(1, except_streams) /* ARRAY_INFO(1, except_streams, 1) */
2032: ZEND_ARG_INFO(0, tv_sec)
2033: ZEND_ARG_INFO(0, tv_usec)
2034: ZEND_END_ARG_INFO()
2035:
2036: ZEND_BEGIN_ARG_INFO(arginfo_stream_context_get_options, 0)
2037: ZEND_ARG_INFO(0, stream_or_context)
2038: ZEND_END_ARG_INFO()
2039:
2040: ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_option, 0)
2041: ZEND_ARG_INFO(0, stream_or_context)
2042: ZEND_ARG_INFO(0, wrappername)
2043: ZEND_ARG_INFO(0, optionname)
2044: ZEND_ARG_INFO(0, value)
2045: ZEND_END_ARG_INFO()
2046:
2047: ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_params, 0)
2048: ZEND_ARG_INFO(0, stream_or_context)
2049: ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
2050: ZEND_END_ARG_INFO()
2051:
2052: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_params, 0, ZEND_RETURN_VALUE, 1)
2053: ZEND_ARG_INFO(0, stream_or_context)
2054: ZEND_END_ARG_INFO()
2055:
2056: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0)
2057: ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
2058: ZEND_END_ARG_INFO()
2059:
2060: ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_default, 0)
2061: ZEND_ARG_INFO(0, options)
2062: ZEND_END_ARG_INFO()
2063:
2064: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0)
2065: ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
2066: ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
2067: ZEND_END_ARG_INFO()
2068:
2069: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2)
2070: ZEND_ARG_INFO(0, stream)
2071: ZEND_ARG_INFO(0, filtername)
2072: ZEND_ARG_INFO(0, read_write)
2073: ZEND_ARG_INFO(0, filterparams)
2074: ZEND_END_ARG_INFO()
2075:
2076: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2)
2077: ZEND_ARG_INFO(0, stream)
2078: ZEND_ARG_INFO(0, filtername)
2079: ZEND_ARG_INFO(0, read_write)
2080: ZEND_ARG_INFO(0, filterparams)
2081: ZEND_END_ARG_INFO()
2082:
2083: ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_remove, 0)
2084: ZEND_ARG_INFO(0, stream_filter)
2085: ZEND_END_ARG_INFO()
2086:
2087: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_line, 0, 0, 2)
2088: ZEND_ARG_INFO(0, stream)
2089: ZEND_ARG_INFO(0, maxlen)
2090: ZEND_ARG_INFO(0, ending)
2091: ZEND_END_ARG_INFO()
2092:
2093: ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0)
2094: ZEND_ARG_INFO(0, socket)
2095: ZEND_ARG_INFO(0, mode)
2096: ZEND_END_ARG_INFO()
2097:
2098: #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
2099: ZEND_BEGIN_ARG_INFO(arginfo_stream_set_timeout, 0)
2100: ZEND_ARG_INFO(0, stream)
2101: ZEND_ARG_INFO(0, seconds)
2102: ZEND_ARG_INFO(0, microseconds)
2103: ZEND_END_ARG_INFO()
2104: #endif
2105:
2106: ZEND_BEGIN_ARG_INFO(arginfo_stream_set_read_buffer, 0)
2107: ZEND_ARG_INFO(0, fp)
2108: ZEND_ARG_INFO(0, buffer)
2109: ZEND_END_ARG_INFO()
2110:
2111: ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0)
2112: ZEND_ARG_INFO(0, fp)
2113: ZEND_ARG_INFO(0, buffer)
2114: ZEND_END_ARG_INFO()
2115:
2116: ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2)
2117: ZEND_ARG_INFO(0, stream)
2118: ZEND_ARG_INFO(0, enable)
2119: ZEND_ARG_INFO(0, cryptokind)
2120: ZEND_ARG_INFO(0, sessionstream)
2121: ZEND_END_ARG_INFO()
2122:
2123: #ifdef HAVE_SHUTDOWN
2124: ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_shutdown, 0)
2125: ZEND_ARG_INFO(0, stream)
2126: ZEND_ARG_INFO(0, how)
2127: ZEND_END_ARG_INFO()
2128: #endif
2129: /* }}} */
2130: /* {{{ string.c */
2131: ZEND_BEGIN_ARG_INFO(arginfo_bin2hex, 0)
2132: ZEND_ARG_INFO(0, data)
2133: ZEND_END_ARG_INFO()
2134:
2135: ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2)
2136: ZEND_ARG_INFO(0, str)
2137: ZEND_ARG_INFO(0, mask)
2138: ZEND_ARG_INFO(0, start)
2139: ZEND_ARG_INFO(0, len)
2140: ZEND_END_ARG_INFO()
2141:
2142: ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2)
2143: ZEND_ARG_INFO(0, str)
2144: ZEND_ARG_INFO(0, mask)
2145: ZEND_ARG_INFO(0, start)
2146: ZEND_ARG_INFO(0, len)
2147: ZEND_END_ARG_INFO()
2148:
2149: #if HAVE_NL_LANGINFO
2150: ZEND_BEGIN_ARG_INFO(arginfo_nl_langinfo, 0)
2151: ZEND_ARG_INFO(0, item)
2152: ZEND_END_ARG_INFO()
2153: #endif
2154:
2155: #ifdef HAVE_STRCOLL
2156: ZEND_BEGIN_ARG_INFO(arginfo_strcoll, 0)
2157: ZEND_ARG_INFO(0, str1)
2158: ZEND_ARG_INFO(0, str2)
2159: ZEND_END_ARG_INFO()
2160: #endif
2161:
2162: ZEND_BEGIN_ARG_INFO_EX(arginfo_trim, 0, 0, 1)
2163: ZEND_ARG_INFO(0, str)
2164: ZEND_ARG_INFO(0, character_mask)
2165: ZEND_END_ARG_INFO()
2166:
2167: ZEND_BEGIN_ARG_INFO_EX(arginfo_rtrim, 0, 0, 1)
2168: ZEND_ARG_INFO(0, str)
2169: ZEND_ARG_INFO(0, character_mask)
2170: ZEND_END_ARG_INFO()
2171:
2172: ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 1)
2173: ZEND_ARG_INFO(0, str)
2174: ZEND_ARG_INFO(0, character_mask)
2175: ZEND_END_ARG_INFO()
2176:
2177: ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1)
2178: ZEND_ARG_INFO(0, str)
2179: ZEND_ARG_INFO(0, width)
2180: ZEND_ARG_INFO(0, break)
2181: ZEND_ARG_INFO(0, cut)
2182: ZEND_END_ARG_INFO()
2183:
2184: ZEND_BEGIN_ARG_INFO_EX(arginfo_explode, 0, 0, 2)
2185: ZEND_ARG_INFO(0, separator)
2186: ZEND_ARG_INFO(0, str)
2187: ZEND_ARG_INFO(0, limit)
2188: ZEND_END_ARG_INFO()
2189:
2190: ZEND_BEGIN_ARG_INFO(arginfo_implode, 0)
2191: ZEND_ARG_INFO(0, glue)
2192: ZEND_ARG_INFO(0, pieces)
2193: ZEND_END_ARG_INFO()
2194:
2195: ZEND_BEGIN_ARG_INFO(arginfo_strtok, 0)
2196: ZEND_ARG_INFO(0, str)
2197: ZEND_ARG_INFO(0, token)
2198: ZEND_END_ARG_INFO()
2199:
2200: ZEND_BEGIN_ARG_INFO(arginfo_strtoupper, 0)
2201: ZEND_ARG_INFO(0, str)
2202: ZEND_END_ARG_INFO()
2203:
2204: ZEND_BEGIN_ARG_INFO(arginfo_strtolower, 0)
2205: ZEND_ARG_INFO(0, str)
2206: ZEND_END_ARG_INFO()
2207:
2208: ZEND_BEGIN_ARG_INFO_EX(arginfo_basename, 0, 0, 1)
2209: ZEND_ARG_INFO(0, path)
2210: ZEND_ARG_INFO(0, suffix)
2211: ZEND_END_ARG_INFO()
2212:
2213: ZEND_BEGIN_ARG_INFO(arginfo_dirname, 0)
2214: ZEND_ARG_INFO(0, path)
2215: ZEND_END_ARG_INFO()
2216:
2217: ZEND_BEGIN_ARG_INFO_EX(arginfo_pathinfo, 0, 0, 1)
2218: ZEND_ARG_INFO(0, path)
2219: ZEND_ARG_INFO(0, options)
2220: ZEND_END_ARG_INFO()
2221:
2222: ZEND_BEGIN_ARG_INFO_EX(arginfo_stristr, 0, 0, 2)
2223: ZEND_ARG_INFO(0, haystack)
2224: ZEND_ARG_INFO(0, needle)
2225: ZEND_ARG_INFO(0, part)
2226: ZEND_END_ARG_INFO()
2227:
2228: ZEND_BEGIN_ARG_INFO_EX(arginfo_strstr, 0, 0, 2)
2229: ZEND_ARG_INFO(0, haystack)
2230: ZEND_ARG_INFO(0, needle)
2231: ZEND_ARG_INFO(0, part)
2232: ZEND_END_ARG_INFO()
2233:
2234: ZEND_BEGIN_ARG_INFO_EX(arginfo_strpos, 0, 0, 2)
2235: ZEND_ARG_INFO(0, haystack)
2236: ZEND_ARG_INFO(0, needle)
2237: ZEND_ARG_INFO(0, offset)
2238: ZEND_END_ARG_INFO()
2239:
2240: ZEND_BEGIN_ARG_INFO_EX(arginfo_stripos, 0, 0, 2)
2241: ZEND_ARG_INFO(0, haystack)
2242: ZEND_ARG_INFO(0, needle)
2243: ZEND_ARG_INFO(0, offset)
2244: ZEND_END_ARG_INFO()
2245:
2246: ZEND_BEGIN_ARG_INFO_EX(arginfo_strrpos, 0, 0, 2)
2247: ZEND_ARG_INFO(0, haystack)
2248: ZEND_ARG_INFO(0, needle)
2249: ZEND_ARG_INFO(0, offset)
2250: ZEND_END_ARG_INFO()
2251:
2252: ZEND_BEGIN_ARG_INFO_EX(arginfo_strripos, 0, 0, 2)
2253: ZEND_ARG_INFO(0, haystack)
2254: ZEND_ARG_INFO(0, needle)
2255: ZEND_ARG_INFO(0, offset)
2256: ZEND_END_ARG_INFO()
2257:
2258: ZEND_BEGIN_ARG_INFO(arginfo_strrchr, 0)
2259: ZEND_ARG_INFO(0, haystack)
2260: ZEND_ARG_INFO(0, needle)
2261: ZEND_END_ARG_INFO()
2262:
2263: ZEND_BEGIN_ARG_INFO_EX(arginfo_chunk_split, 0, 0, 1)
2264: ZEND_ARG_INFO(0, str)
2265: ZEND_ARG_INFO(0, chunklen)
2266: ZEND_ARG_INFO(0, ending)
2267: ZEND_END_ARG_INFO()
2268:
2269: ZEND_BEGIN_ARG_INFO_EX(arginfo_substr, 0, 0, 2)
2270: ZEND_ARG_INFO(0, str)
2271: ZEND_ARG_INFO(0, start)
2272: ZEND_ARG_INFO(0, length)
2273: ZEND_END_ARG_INFO()
2274:
2275: ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3)
2276: ZEND_ARG_INFO(0, str)
2277: ZEND_ARG_INFO(0, replace)
2278: ZEND_ARG_INFO(0, start)
2279: ZEND_ARG_INFO(0, length)
2280: ZEND_END_ARG_INFO()
2281:
2282: ZEND_BEGIN_ARG_INFO(arginfo_quotemeta, 0)
2283: ZEND_ARG_INFO(0, str)
2284: ZEND_END_ARG_INFO()
2285:
2286: ZEND_BEGIN_ARG_INFO(arginfo_ord, 0)
2287: ZEND_ARG_INFO(0, character)
2288: ZEND_END_ARG_INFO()
2289:
2290: ZEND_BEGIN_ARG_INFO(arginfo_chr, 0)
2291: ZEND_ARG_INFO(0, codepoint)
2292: ZEND_END_ARG_INFO()
2293:
2294: ZEND_BEGIN_ARG_INFO(arginfo_ucfirst, 0)
2295: ZEND_ARG_INFO(0, str)
2296: ZEND_END_ARG_INFO()
2297:
2298: ZEND_BEGIN_ARG_INFO(arginfo_lcfirst, 0)
2299: ZEND_ARG_INFO(0, str)
2300: ZEND_END_ARG_INFO()
2301:
2302: ZEND_BEGIN_ARG_INFO(arginfo_ucwords, 0)
2303: ZEND_ARG_INFO(0, str)
2304: ZEND_END_ARG_INFO()
2305:
2306: ZEND_BEGIN_ARG_INFO_EX(arginfo_strtr, 0, 0, 2)
2307: ZEND_ARG_INFO(0, str)
2308: ZEND_ARG_INFO(0, from)
2309: ZEND_ARG_INFO(0, to)
2310: ZEND_END_ARG_INFO()
2311:
2312: ZEND_BEGIN_ARG_INFO(arginfo_strrev, 0)
2313: ZEND_ARG_INFO(0, str)
2314: ZEND_END_ARG_INFO()
2315:
2316: ZEND_BEGIN_ARG_INFO_EX(arginfo_similar_text, 0, 0, 2)
2317: ZEND_ARG_INFO(0, str1)
2318: ZEND_ARG_INFO(0, str2)
2319: ZEND_ARG_INFO(1, percent)
2320: ZEND_END_ARG_INFO()
2321:
2322: ZEND_BEGIN_ARG_INFO(arginfo_addcslashes, 0)
2323: ZEND_ARG_INFO(0, str)
2324: ZEND_ARG_INFO(0, charlist)
2325: ZEND_END_ARG_INFO()
2326:
2327: ZEND_BEGIN_ARG_INFO(arginfo_addslashes, 0)
2328: ZEND_ARG_INFO(0, str)
2329: ZEND_END_ARG_INFO()
2330:
2331: ZEND_BEGIN_ARG_INFO(arginfo_stripcslashes, 0)
2332: ZEND_ARG_INFO(0, str)
2333: ZEND_END_ARG_INFO()
2334:
2335: ZEND_BEGIN_ARG_INFO(arginfo_stripslashes, 0)
2336: ZEND_ARG_INFO(0, str)
2337: ZEND_END_ARG_INFO()
2338:
2339: ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3)
2340: ZEND_ARG_INFO(0, search)
2341: ZEND_ARG_INFO(0, replace)
2342: ZEND_ARG_INFO(0, subject)
2343: ZEND_ARG_INFO(1, replace_count)
2344: ZEND_END_ARG_INFO()
2345:
2346: ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3)
2347: ZEND_ARG_INFO(0, search)
2348: ZEND_ARG_INFO(0, replace)
2349: ZEND_ARG_INFO(0, subject)
2350: ZEND_ARG_INFO(1, replace_count)
2351: ZEND_END_ARG_INFO()
2352:
2353: ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrev, 0, 0, 1)
2354: ZEND_ARG_INFO(0, str)
2355: ZEND_ARG_INFO(0, max_chars_per_line)
2356: ZEND_END_ARG_INFO()
2357:
2358: ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrevc, 0, 0, 1)
2359: ZEND_ARG_INFO(0, str)
2360: ZEND_ARG_INFO(0, max_chars_per_line)
2361: ZEND_END_ARG_INFO()
2362:
2363: ZEND_BEGIN_ARG_INFO_EX(arginfo_nl2br, 0, 0, 1)
2364: ZEND_ARG_INFO(0, str)
2365: ZEND_ARG_INFO(0, is_xhtml)
2366: ZEND_END_ARG_INFO()
2367:
2368: ZEND_BEGIN_ARG_INFO_EX(arginfo_strip_tags, 0, 0, 1)
2369: ZEND_ARG_INFO(0, str)
2370: ZEND_ARG_INFO(0, allowable_tags)
2371: ZEND_END_ARG_INFO()
2372:
2373: ZEND_BEGIN_ARG_INFO_EX(arginfo_setlocale, 0, 0, 2)
2374: ZEND_ARG_INFO(0, category)
2375: ZEND_ARG_INFO(0, locale)
2376: ZEND_ARG_INFO(0, ...)
2377: ZEND_END_ARG_INFO()
2378:
2379: ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1)
2380: ZEND_ARG_INFO(0, encoded_string)
2381: ZEND_ARG_INFO(1, result)
2382: ZEND_END_ARG_INFO()
2383:
2384: ZEND_BEGIN_ARG_INFO_EX(arginfo_str_getcsv, 0, 0, 1)
2385: ZEND_ARG_INFO(0, string)
2386: ZEND_ARG_INFO(0, delimiter)
2387: ZEND_ARG_INFO(0, enclosure)
2388: ZEND_ARG_INFO(0, escape)
2389: ZEND_END_ARG_INFO()
2390:
2391: ZEND_BEGIN_ARG_INFO(arginfo_str_repeat, 0)
2392: ZEND_ARG_INFO(0, input)
2393: ZEND_ARG_INFO(0, mult)
2394: ZEND_END_ARG_INFO()
2395:
2396: ZEND_BEGIN_ARG_INFO_EX(arginfo_count_chars, 0, 0, 1)
2397: ZEND_ARG_INFO(0, input)
2398: ZEND_ARG_INFO(0, mode)
2399: ZEND_END_ARG_INFO()
2400:
2401: ZEND_BEGIN_ARG_INFO(arginfo_strnatcmp, 0)
2402: ZEND_ARG_INFO(0, s1)
2403: ZEND_ARG_INFO(0, s2)
2404: ZEND_END_ARG_INFO()
2405:
2406: ZEND_BEGIN_ARG_INFO(arginfo_localeconv, 0)
2407: ZEND_END_ARG_INFO()
2408:
2409: ZEND_BEGIN_ARG_INFO(arginfo_strnatcasecmp, 0)
2410: ZEND_ARG_INFO(0, s1)
2411: ZEND_ARG_INFO(0, s2)
2412: ZEND_END_ARG_INFO()
2413:
2414: ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2)
2415: ZEND_ARG_INFO(0, haystack)
2416: ZEND_ARG_INFO(0, needle)
2417: ZEND_ARG_INFO(0, offset)
2418: ZEND_ARG_INFO(0, length)
2419: ZEND_END_ARG_INFO()
2420:
2421: ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2)
2422: ZEND_ARG_INFO(0, input)
2423: ZEND_ARG_INFO(0, pad_length)
2424: ZEND_ARG_INFO(0, pad_string)
2425: ZEND_ARG_INFO(0, pad_type)
2426: ZEND_END_ARG_INFO()
2427:
2428: ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 1, 0, 2)
2429: ZEND_ARG_INFO(0, str)
2430: ZEND_ARG_INFO(0, format)
2431: ZEND_ARG_INFO(1, ...)
2432: ZEND_END_ARG_INFO()
2433:
2434: ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0)
2435: ZEND_ARG_INFO(0, str)
2436: ZEND_END_ARG_INFO()
2437:
2438: ZEND_BEGIN_ARG_INFO(arginfo_str_shuffle, 0)
2439: ZEND_ARG_INFO(0, str)
2440: ZEND_END_ARG_INFO()
2441:
2442: ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1)
2443: ZEND_ARG_INFO(0, str)
2444: ZEND_ARG_INFO(0, format)
2445: ZEND_ARG_INFO(0, charlist)
2446: ZEND_END_ARG_INFO()
2447:
2448: #ifdef HAVE_STRFMON
2449: ZEND_BEGIN_ARG_INFO(arginfo_money_format, 0)
2450: ZEND_ARG_INFO(0, format)
2451: ZEND_ARG_INFO(0, value)
2452: ZEND_END_ARG_INFO()
2453: #endif
2454:
2455: ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1)
2456: ZEND_ARG_INFO(0, str)
2457: ZEND_ARG_INFO(0, split_length)
2458: ZEND_END_ARG_INFO()
2459:
2460: ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 1)
2461: ZEND_ARG_INFO(0, haystack)
2462: ZEND_ARG_INFO(0, char_list)
2463: ZEND_END_ARG_INFO()
2464:
2465: ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_compare, 0, 0, 3)
2466: ZEND_ARG_INFO(0, main_str)
2467: ZEND_ARG_INFO(0, str)
2468: ZEND_ARG_INFO(0, offset)
2469: ZEND_ARG_INFO(0, length)
2470: ZEND_ARG_INFO(0, case_sensitivity)
2471: ZEND_END_ARG_INFO()
2472: /* }}} */
2473: /* {{{ syslog.c */
2474: #ifdef HAVE_SYSLOG_H
2475: ZEND_BEGIN_ARG_INFO(arginfo_define_syslog_variables, 0)
2476: ZEND_END_ARG_INFO()
2477:
2478: ZEND_BEGIN_ARG_INFO(arginfo_openlog, 0)
2479: ZEND_ARG_INFO(0, ident)
2480: ZEND_ARG_INFO(0, option)
2481: ZEND_ARG_INFO(0, facility)
2482: ZEND_END_ARG_INFO()
2483:
2484: ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0)
2485: ZEND_END_ARG_INFO()
2486:
2487: ZEND_BEGIN_ARG_INFO(arginfo_syslog, 0)
2488: ZEND_ARG_INFO(0, priority)
2489: ZEND_ARG_INFO(0, message)
2490: ZEND_END_ARG_INFO()
2491: #endif
2492: /* }}} */
2493: /* {{{ type.c */
2494: ZEND_BEGIN_ARG_INFO(arginfo_gettype, 0)
2495: ZEND_ARG_INFO(0, var)
2496: ZEND_END_ARG_INFO()
2497:
2498: ZEND_BEGIN_ARG_INFO(arginfo_settype, 0)
2499: ZEND_ARG_INFO(1, var)
2500: ZEND_ARG_INFO(0, type)
2501: ZEND_END_ARG_INFO()
2502:
2503: ZEND_BEGIN_ARG_INFO_EX(arginfo_intval, 0, 0, 1)
2504: ZEND_ARG_INFO(0, var)
2505: ZEND_ARG_INFO(0, base)
2506: ZEND_END_ARG_INFO()
2507:
2508: ZEND_BEGIN_ARG_INFO(arginfo_floatval, 0)
2509: ZEND_ARG_INFO(0, var)
2510: ZEND_END_ARG_INFO()
2511:
2512: ZEND_BEGIN_ARG_INFO(arginfo_strval, 0)
2513: ZEND_ARG_INFO(0, var)
2514: ZEND_END_ARG_INFO()
2515:
2516: ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0)
2517: ZEND_ARG_INFO(0, var)
2518: ZEND_END_ARG_INFO()
2519:
2520: ZEND_BEGIN_ARG_INFO(arginfo_is_resource, 0)
2521: ZEND_ARG_INFO(0, var)
2522: ZEND_END_ARG_INFO()
2523:
2524: ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0)
2525: ZEND_ARG_INFO(0, var)
2526: ZEND_END_ARG_INFO()
2527:
2528: ZEND_BEGIN_ARG_INFO(arginfo_is_long, 0)
2529: ZEND_ARG_INFO(0, var)
2530: ZEND_END_ARG_INFO()
2531:
2532: ZEND_BEGIN_ARG_INFO(arginfo_is_float, 0)
2533: ZEND_ARG_INFO(0, var)
2534: ZEND_END_ARG_INFO()
2535:
2536: ZEND_BEGIN_ARG_INFO(arginfo_is_string, 0)
2537: ZEND_ARG_INFO(0, var)
2538: ZEND_END_ARG_INFO()
2539:
2540: ZEND_BEGIN_ARG_INFO(arginfo_is_array, 0)
2541: ZEND_ARG_INFO(0, var)
2542: ZEND_END_ARG_INFO()
2543:
2544: ZEND_BEGIN_ARG_INFO(arginfo_is_object, 0)
2545: ZEND_ARG_INFO(0, var)
2546: ZEND_END_ARG_INFO()
2547:
2548: ZEND_BEGIN_ARG_INFO(arginfo_is_numeric, 0)
2549: ZEND_ARG_INFO(0, value)
2550: ZEND_END_ARG_INFO()
2551:
2552: ZEND_BEGIN_ARG_INFO(arginfo_is_scalar, 0)
2553: ZEND_ARG_INFO(0, value)
2554: ZEND_END_ARG_INFO()
2555:
2556: ZEND_BEGIN_ARG_INFO_EX(arginfo_is_callable, 0, 0, 1)
2557: ZEND_ARG_INFO(0, var)
2558: ZEND_ARG_INFO(0, syntax_only)
2559: ZEND_ARG_INFO(1, callable_name)
2560: ZEND_END_ARG_INFO()
2561: /* }}} */
2562: /* {{{ uniqid.c */
2563: #ifdef HAVE_GETTIMEOFDAY
2564: ZEND_BEGIN_ARG_INFO_EX(arginfo_uniqid, 0, 0, 0)
2565: ZEND_ARG_INFO(0, prefix)
2566: ZEND_ARG_INFO(0, more_entropy)
2567: ZEND_END_ARG_INFO()
2568: #endif
2569: /* }}} */
2570: /* {{{ url.c */
2571: ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1)
2572: ZEND_ARG_INFO(0, url)
2573: ZEND_ARG_INFO(0, component)
2574: ZEND_END_ARG_INFO()
2575:
2576: ZEND_BEGIN_ARG_INFO(arginfo_urlencode, 0)
2577: ZEND_ARG_INFO(0, str)
2578: ZEND_END_ARG_INFO()
2579:
2580: ZEND_BEGIN_ARG_INFO(arginfo_urldecode, 0)
2581: ZEND_ARG_INFO(0, str)
2582: ZEND_END_ARG_INFO()
2583:
2584: ZEND_BEGIN_ARG_INFO(arginfo_rawurlencode, 0)
2585: ZEND_ARG_INFO(0, str)
2586: ZEND_END_ARG_INFO()
2587:
2588: ZEND_BEGIN_ARG_INFO(arginfo_rawurldecode, 0)
2589: ZEND_ARG_INFO(0, str)
2590: ZEND_END_ARG_INFO()
2591:
2592: ZEND_BEGIN_ARG_INFO_EX(arginfo_get_headers, 0, 0, 1)
2593: ZEND_ARG_INFO(0, url)
2594: ZEND_ARG_INFO(0, format)
2595: ZEND_END_ARG_INFO()
2596: /* }}} */
2597: /* {{{ user_filters.c */
2598: ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_make_writeable, 0)
2599: ZEND_ARG_INFO(0, brigade)
2600: ZEND_END_ARG_INFO()
2601:
2602: ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_prepend, 0)
2603: ZEND_ARG_INFO(0, brigade)
2604: ZEND_ARG_INFO(0, bucket)
2605: ZEND_END_ARG_INFO()
2606:
2607: ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_append, 0)
2608: ZEND_ARG_INFO(0, brigade)
2609: ZEND_ARG_INFO(0, bucket)
2610: ZEND_END_ARG_INFO()
2611:
2612: ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_new, 0)
2613: ZEND_ARG_INFO(0, stream)
2614: ZEND_ARG_INFO(0, buffer)
2615: ZEND_END_ARG_INFO()
2616:
2617: ZEND_BEGIN_ARG_INFO(arginfo_stream_get_filters, 0)
2618: ZEND_END_ARG_INFO()
2619:
2620: ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_register, 0)
2621: ZEND_ARG_INFO(0, filtername)
2622: ZEND_ARG_INFO(0, classname)
2623: ZEND_END_ARG_INFO()
2624: /* }}} */
2625: /* {{{ uuencode.c */
2626: ZEND_BEGIN_ARG_INFO(arginfo_convert_uuencode, 0)
2627: ZEND_ARG_INFO(0, data)
2628: ZEND_END_ARG_INFO()
2629:
2630: ZEND_BEGIN_ARG_INFO(arginfo_convert_uudecode, 0)
2631: ZEND_ARG_INFO(0, data)
2632: ZEND_END_ARG_INFO()
2633: /* }}} */
2634: /* {{{ var.c */
2635: ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1)
2636: ZEND_ARG_INFO(0, var)
2637: ZEND_ARG_INFO(0, ...)
2638: ZEND_END_ARG_INFO()
2639:
2640: ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1)
2641: ZEND_ARG_INFO(0, var)
2642: ZEND_ARG_INFO(0, ...)
2643: ZEND_END_ARG_INFO()
2644:
2645: ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1)
2646: ZEND_ARG_INFO(0, var)
2647: ZEND_ARG_INFO(0, return)
2648: ZEND_END_ARG_INFO()
2649:
2650: ZEND_BEGIN_ARG_INFO(arginfo_serialize, 0)
2651: ZEND_ARG_INFO(0, var)
2652: ZEND_END_ARG_INFO()
2653:
2654: ZEND_BEGIN_ARG_INFO(arginfo_unserialize, 0)
2655: ZEND_ARG_INFO(0, variable_representation)
2656: ZEND_END_ARG_INFO()
2657:
2658: ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0)
2659: ZEND_ARG_INFO(0, real_usage)
2660: ZEND_END_ARG_INFO()
2661:
2662: ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0)
2663: ZEND_ARG_INFO(0, real_usage)
2664: ZEND_END_ARG_INFO()
2665: /* }}} */
2666: /* {{{ versioning.c */
2667: ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
2668: ZEND_ARG_INFO(0, ver1)
2669: ZEND_ARG_INFO(0, ver2)
2670: ZEND_ARG_INFO(0, oper)
2671: ZEND_END_ARG_INFO()
2672: /* }}} */
2673: /* }}} */
2674:
2675: const zend_function_entry basic_functions[] = { /* {{{ */
2676: PHP_FE(constant, arginfo_constant)
2677: PHP_FE(bin2hex, arginfo_bin2hex)
2678: PHP_FE(sleep, arginfo_sleep)
2679: PHP_FE(usleep, arginfo_usleep)
2680: #if HAVE_NANOSLEEP
2681: PHP_FE(time_nanosleep, arginfo_time_nanosleep)
2682: PHP_FE(time_sleep_until, arginfo_time_sleep_until)
2683: #endif
2684:
2685: #if HAVE_STRPTIME
2686: PHP_FE(strptime, arginfo_strptime)
2687: #endif
2688:
2689: PHP_FE(flush, arginfo_flush)
2690: PHP_FE(wordwrap, arginfo_wordwrap)
2691: PHP_FE(htmlspecialchars, arginfo_htmlspecialchars)
2692: PHP_FE(htmlentities, arginfo_htmlentities)
2693: PHP_FE(html_entity_decode, arginfo_html_entity_decode)
2694: PHP_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode)
2695: PHP_FE(get_html_translation_table, arginfo_get_html_translation_table)
2696: PHP_FE(sha1, arginfo_sha1)
2697: PHP_FE(sha1_file, arginfo_sha1_file)
2698: PHP_NAMED_FE(md5,php_if_md5, arginfo_md5)
2699: PHP_NAMED_FE(md5_file,php_if_md5_file, arginfo_md5_file)
2700: PHP_NAMED_FE(crc32,php_if_crc32, arginfo_crc32)
2701:
2702: PHP_FE(iptcparse, arginfo_iptcparse)
2703: PHP_FE(iptcembed, arginfo_iptcembed)
2704: PHP_FE(getimagesize, arginfo_getimagesize)
2705: PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type)
2706: PHP_FE(image_type_to_extension, arginfo_image_type_to_extension)
2707:
2708: PHP_FE(phpinfo, arginfo_phpinfo)
2709: PHP_FE(phpversion, arginfo_phpversion)
2710: PHP_FE(phpcredits, arginfo_phpcredits)
2711: PHP_FE(php_logo_guid, arginfo_php_logo_guid)
2712: PHP_FE(php_real_logo_guid, arginfo_php_real_logo_guid)
2713: PHP_FE(php_egg_logo_guid, arginfo_php_egg_logo_guid)
2714: PHP_FE(zend_logo_guid, arginfo_zend_logo_guid)
2715: PHP_FE(php_sapi_name, arginfo_php_sapi_name)
2716: PHP_FE(php_uname, arginfo_php_uname)
2717: PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
2718: PHP_FE(php_ini_loaded_file, arginfo_php_ini_loaded_file)
2719:
2720: PHP_FE(strnatcmp, arginfo_strnatcmp)
2721: PHP_FE(strnatcasecmp, arginfo_strnatcasecmp)
2722: PHP_FE(substr_count, arginfo_substr_count)
2723: PHP_FE(strspn, arginfo_strspn)
2724: PHP_FE(strcspn, arginfo_strcspn)
2725: PHP_FE(strtok, arginfo_strtok)
2726: PHP_FE(strtoupper, arginfo_strtoupper)
2727: PHP_FE(strtolower, arginfo_strtolower)
2728: PHP_FE(strpos, arginfo_strpos)
2729: PHP_FE(stripos, arginfo_stripos)
2730: PHP_FE(strrpos, arginfo_strrpos)
2731: PHP_FE(strripos, arginfo_strripos)
2732: PHP_FE(strrev, arginfo_strrev)
2733: PHP_FE(hebrev, arginfo_hebrev)
2734: PHP_FE(hebrevc, arginfo_hebrevc)
2735: PHP_FE(nl2br, arginfo_nl2br)
2736: PHP_FE(basename, arginfo_basename)
2737: PHP_FE(dirname, arginfo_dirname)
2738: PHP_FE(pathinfo, arginfo_pathinfo)
2739: PHP_FE(stripslashes, arginfo_stripslashes)
2740: PHP_FE(stripcslashes, arginfo_stripcslashes)
2741: PHP_FE(strstr, arginfo_strstr)
2742: PHP_FE(stristr, arginfo_stristr)
2743: PHP_FE(strrchr, arginfo_strrchr)
2744: PHP_FE(str_shuffle, arginfo_str_shuffle)
2745: PHP_FE(str_word_count, arginfo_str_word_count)
2746: PHP_FE(str_split, arginfo_str_split)
2747: PHP_FE(strpbrk, arginfo_strpbrk)
2748: PHP_FE(substr_compare, arginfo_substr_compare)
2749:
2750: #ifdef HAVE_STRCOLL
2751: PHP_FE(strcoll, arginfo_strcoll)
2752: #endif
2753:
2754: #ifdef HAVE_STRFMON
2755: PHP_FE(money_format, arginfo_money_format)
2756: #endif
2757:
2758: PHP_FE(substr, arginfo_substr)
2759: PHP_FE(substr_replace, arginfo_substr_replace)
2760: PHP_FE(quotemeta, arginfo_quotemeta)
2761: PHP_FE(ucfirst, arginfo_ucfirst)
2762: PHP_FE(lcfirst, arginfo_lcfirst)
2763: PHP_FE(ucwords, arginfo_ucwords)
2764: PHP_FE(strtr, arginfo_strtr)
2765: PHP_FE(addslashes, arginfo_addslashes)
2766: PHP_FE(addcslashes, arginfo_addcslashes)
2767: PHP_FE(rtrim, arginfo_rtrim)
2768: PHP_FE(str_replace, arginfo_str_replace)
2769: PHP_FE(str_ireplace, arginfo_str_ireplace)
2770: PHP_FE(str_repeat, arginfo_str_repeat)
2771: PHP_FE(count_chars, arginfo_count_chars)
2772: PHP_FE(chunk_split, arginfo_chunk_split)
2773: PHP_FE(trim, arginfo_trim)
2774: PHP_FE(ltrim, arginfo_ltrim)
2775: PHP_FE(strip_tags, arginfo_strip_tags)
2776: PHP_FE(similar_text, arginfo_similar_text)
2777: PHP_FE(explode, arginfo_explode)
2778: PHP_FE(implode, arginfo_implode)
2779: PHP_FALIAS(join, implode, arginfo_implode)
2780: PHP_FE(setlocale, arginfo_setlocale)
2781: PHP_FE(localeconv, arginfo_localeconv)
2782:
2783: #if HAVE_NL_LANGINFO
2784: PHP_FE(nl_langinfo, arginfo_nl_langinfo)
2785: #endif
2786:
2787: PHP_FE(soundex, arginfo_soundex)
2788: PHP_FE(levenshtein, arginfo_levenshtein)
2789: PHP_FE(chr, arginfo_chr)
2790: PHP_FE(ord, arginfo_ord)
2791: PHP_FE(parse_str, arginfo_parse_str)
2792: PHP_FE(str_getcsv, arginfo_str_getcsv)
2793: PHP_FE(str_pad, arginfo_str_pad)
2794: PHP_FALIAS(chop, rtrim, arginfo_rtrim)
2795: PHP_FALIAS(strchr, strstr, arginfo_strstr)
2796: PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), arginfo_sprintf)
2797: PHP_NAMED_FE(printf, PHP_FN(user_printf), arginfo_printf)
2798: PHP_FE(vprintf, arginfo_vprintf)
2799: PHP_FE(vsprintf, arginfo_vsprintf)
2800: PHP_FE(fprintf, arginfo_fprintf)
2801: PHP_FE(vfprintf, arginfo_vfprintf)
2802: PHP_FE(sscanf, arginfo_sscanf)
2803: PHP_FE(fscanf, arginfo_fscanf)
2804: PHP_FE(parse_url, arginfo_parse_url)
2805: PHP_FE(urlencode, arginfo_urlencode)
2806: PHP_FE(urldecode, arginfo_urldecode)
2807: PHP_FE(rawurlencode, arginfo_rawurlencode)
2808: PHP_FE(rawurldecode, arginfo_rawurldecode)
2809: PHP_FE(http_build_query, arginfo_http_build_query)
2810:
2811: #if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
2812: PHP_FE(readlink, arginfo_readlink)
2813: PHP_FE(linkinfo, arginfo_linkinfo)
2814: PHP_FE(symlink, arginfo_symlink)
2815: PHP_FE(link, arginfo_link)
2816: #endif
2817:
2818: PHP_FE(unlink, arginfo_unlink)
2819: PHP_FE(exec, arginfo_exec)
2820: PHP_FE(system, arginfo_system)
2821: PHP_FE(escapeshellcmd, arginfo_escapeshellcmd)
2822: PHP_FE(escapeshellarg, arginfo_escapeshellarg)
2823: PHP_FE(passthru, arginfo_passthru)
2824: PHP_FE(shell_exec, arginfo_shell_exec)
2825: #ifdef PHP_CAN_SUPPORT_PROC_OPEN
2826: PHP_FE(proc_open, arginfo_proc_open)
2827: PHP_FE(proc_close, arginfo_proc_close)
2828: PHP_FE(proc_terminate, arginfo_proc_terminate)
2829: PHP_FE(proc_get_status, arginfo_proc_get_status)
2830: #endif
2831:
2832: #ifdef HAVE_NICE
2833: PHP_FE(proc_nice, arginfo_proc_nice)
2834: #endif
2835:
2836: PHP_FE(rand, arginfo_rand)
2837: PHP_FE(srand, arginfo_srand)
2838: PHP_FE(getrandmax, arginfo_getrandmax)
2839: PHP_FE(mt_rand, arginfo_mt_rand)
2840: PHP_FE(mt_srand, arginfo_mt_srand)
2841: PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
2842:
2843: #if HAVE_GETSERVBYNAME
2844: PHP_FE(getservbyname, arginfo_getservbyname)
2845: #endif
2846:
2847: #if HAVE_GETSERVBYPORT
2848: PHP_FE(getservbyport, arginfo_getservbyport)
2849: #endif
2850:
2851: #if HAVE_GETPROTOBYNAME
2852: PHP_FE(getprotobyname, arginfo_getprotobyname)
2853: #endif
2854:
2855: #if HAVE_GETPROTOBYNUMBER
2856: PHP_FE(getprotobynumber, arginfo_getprotobynumber)
2857: #endif
2858:
2859: PHP_FE(getmyuid, arginfo_getmyuid)
2860: PHP_FE(getmygid, arginfo_getmygid)
2861: PHP_FE(getmypid, arginfo_getmypid)
2862: PHP_FE(getmyinode, arginfo_getmyinode)
2863: PHP_FE(getlastmod, arginfo_getlastmod)
2864:
2865: PHP_FE(base64_decode, arginfo_base64_decode)
2866: PHP_FE(base64_encode, arginfo_base64_encode)
2867:
2868: PHP_FE(convert_uuencode, arginfo_convert_uuencode)
2869: PHP_FE(convert_uudecode, arginfo_convert_uudecode)
2870:
2871: PHP_FE(abs, arginfo_abs)
2872: PHP_FE(ceil, arginfo_ceil)
2873: PHP_FE(floor, arginfo_floor)
2874: PHP_FE(round, arginfo_round)
2875: PHP_FE(sin, arginfo_sin)
2876: PHP_FE(cos, arginfo_cos)
2877: PHP_FE(tan, arginfo_tan)
2878: PHP_FE(asin, arginfo_asin)
2879: PHP_FE(acos, arginfo_acos)
2880: PHP_FE(atan, arginfo_atan)
2881: PHP_FE(atanh, arginfo_atanh)
2882: PHP_FE(atan2, arginfo_atan2)
2883: PHP_FE(sinh, arginfo_sinh)
2884: PHP_FE(cosh, arginfo_cosh)
2885: PHP_FE(tanh, arginfo_tanh)
2886: PHP_FE(asinh, arginfo_asinh)
2887: PHP_FE(acosh, arginfo_acosh)
2888: PHP_FE(expm1, arginfo_expm1)
2889: PHP_FE(log1p, arginfo_log1p)
2890: PHP_FE(pi, arginfo_pi)
2891: PHP_FE(is_finite, arginfo_is_finite)
2892: PHP_FE(is_nan, arginfo_is_nan)
2893: PHP_FE(is_infinite, arginfo_is_infinite)
2894: PHP_FE(pow, arginfo_pow)
2895: PHP_FE(exp, arginfo_exp)
2896: PHP_FE(log, arginfo_log)
2897: PHP_FE(log10, arginfo_log10)
2898: PHP_FE(sqrt, arginfo_sqrt)
2899: PHP_FE(hypot, arginfo_hypot)
2900: PHP_FE(deg2rad, arginfo_deg2rad)
2901: PHP_FE(rad2deg, arginfo_rad2deg)
2902: PHP_FE(bindec, arginfo_bindec)
2903: PHP_FE(hexdec, arginfo_hexdec)
2904: PHP_FE(octdec, arginfo_octdec)
2905: PHP_FE(decbin, arginfo_decbin)
2906: PHP_FE(decoct, arginfo_decoct)
2907: PHP_FE(dechex, arginfo_dechex)
2908: PHP_FE(base_convert, arginfo_base_convert)
2909: PHP_FE(number_format, arginfo_number_format)
2910: PHP_FE(fmod, arginfo_fmod)
2911: #ifdef HAVE_INET_NTOP
2912: PHP_RAW_NAMED_FE(inet_ntop, php_inet_ntop, arginfo_inet_ntop)
2913: #endif
2914: #ifdef HAVE_INET_PTON
2915: PHP_RAW_NAMED_FE(inet_pton, php_inet_pton, arginfo_inet_pton)
2916: #endif
2917: PHP_FE(ip2long, arginfo_ip2long)
2918: PHP_FE(long2ip, arginfo_long2ip)
2919:
2920: PHP_FE(getenv, arginfo_getenv)
2921: #ifdef HAVE_PUTENV
2922: PHP_FE(putenv, arginfo_putenv)
2923: #endif
2924:
2925: PHP_FE(getopt, arginfo_getopt)
2926:
2927: #ifdef HAVE_GETLOADAVG
2928: PHP_FE(sys_getloadavg, arginfo_sys_getloadavg)
2929: #endif
2930: #ifdef HAVE_GETTIMEOFDAY
2931: PHP_FE(microtime, arginfo_microtime)
2932: PHP_FE(gettimeofday, arginfo_gettimeofday)
2933: #endif
2934:
2935: #ifdef HAVE_GETRUSAGE
2936: PHP_FE(getrusage, arginfo_getrusage)
2937: #endif
2938:
2939: #ifdef HAVE_GETTIMEOFDAY
2940: PHP_FE(uniqid, arginfo_uniqid)
2941: #endif
2942:
2943: PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
2944: PHP_FE(quoted_printable_encode, arginfo_quoted_printable_encode)
2945: PHP_FE(convert_cyr_string, arginfo_convert_cyr_string)
2946: PHP_FE(get_current_user, arginfo_get_current_user)
2947: PHP_FE(set_time_limit, arginfo_set_time_limit)
2948: PHP_FE(get_cfg_var, arginfo_get_cfg_var)
2949:
2950: PHP_DEP_FALIAS(magic_quotes_runtime, set_magic_quotes_runtime, arginfo_set_magic_quotes_runtime)
2951: PHP_DEP_FE(set_magic_quotes_runtime, arginfo_set_magic_quotes_runtime)
2952: PHP_FE(get_magic_quotes_gpc, arginfo_get_magic_quotes_gpc)
2953: PHP_FE(get_magic_quotes_runtime, arginfo_get_magic_quotes_runtime)
2954:
2955: PHP_FE(import_request_variables, arginfo_import_request_variables)
2956: PHP_FE(error_log, arginfo_error_log)
2957: PHP_FE(error_get_last, arginfo_error_get_last)
2958: PHP_FE(call_user_func, arginfo_call_user_func)
2959: PHP_FE(call_user_func_array, arginfo_call_user_func_array)
2960: PHP_DEP_FE(call_user_method, arginfo_call_user_method)
2961: PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array)
2962: PHP_FE(forward_static_call, arginfo_forward_static_call)
2963: PHP_FE(forward_static_call_array, arginfo_forward_static_call_array)
2964: PHP_FE(serialize, arginfo_serialize)
2965: PHP_FE(unserialize, arginfo_unserialize)
2966:
2967: PHP_FE(var_dump, arginfo_var_dump)
2968: PHP_FE(var_export, arginfo_var_export)
2969: PHP_FE(debug_zval_dump, arginfo_debug_zval_dump)
2970: PHP_FE(print_r, arginfo_print_r)
2971: PHP_FE(memory_get_usage, arginfo_memory_get_usage)
2972: PHP_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage)
2973:
2974: PHP_FE(register_shutdown_function, arginfo_register_shutdown_function)
2975: PHP_FE(register_tick_function, arginfo_register_tick_function)
2976: PHP_FE(unregister_tick_function, arginfo_unregister_tick_function)
2977:
2978: PHP_FE(highlight_file, arginfo_highlight_file)
2979: PHP_FALIAS(show_source, highlight_file, arginfo_highlight_file)
2980: PHP_FE(highlight_string, arginfo_highlight_string)
2981: PHP_FE(php_strip_whitespace, arginfo_php_strip_whitespace)
2982:
2983: PHP_FE(ini_get, arginfo_ini_get)
2984: PHP_FE(ini_get_all, arginfo_ini_get_all)
2985: PHP_FE(ini_set, arginfo_ini_set)
2986: PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set)
2987: PHP_FE(ini_restore, arginfo_ini_restore)
2988: PHP_FE(get_include_path, arginfo_get_include_path)
2989: PHP_FE(set_include_path, arginfo_set_include_path)
2990: PHP_FE(restore_include_path, arginfo_restore_include_path)
2991:
2992: PHP_FE(setcookie, arginfo_setcookie)
2993: PHP_FE(setrawcookie, arginfo_setrawcookie)
2994: PHP_FE(header, arginfo_header)
2995: PHP_FE(header_remove, arginfo_header_remove)
2996: PHP_FE(headers_sent, arginfo_headers_sent)
2997: PHP_FE(headers_list, arginfo_headers_list)
2998:
2999: PHP_FE(connection_aborted, arginfo_connection_aborted)
3000: PHP_FE(connection_status, arginfo_connection_status)
3001: PHP_FE(ignore_user_abort, arginfo_ignore_user_abort)
3002: PHP_FE(parse_ini_file, arginfo_parse_ini_file)
3003: PHP_FE(parse_ini_string, arginfo_parse_ini_string)
3004: #if ZEND_DEBUG
3005: PHP_FE(config_get_hash, arginfo_config_get_hash)
3006: #endif
3007: PHP_FE(is_uploaded_file, arginfo_is_uploaded_file)
3008: PHP_FE(move_uploaded_file, arginfo_move_uploaded_file)
3009:
3010: /* functions from dns.c */
3011: PHP_FE(gethostbyaddr, arginfo_gethostbyaddr)
3012: PHP_FE(gethostbyname, arginfo_gethostbyname)
3013: PHP_FE(gethostbynamel, arginfo_gethostbynamel)
3014:
3015: #ifdef HAVE_GETHOSTNAME
3016: PHP_FE(gethostname, arginfo_gethostname)
3017: #endif
3018:
3019: #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
3020:
3021: PHP_FE(dns_check_record, arginfo_dns_check_record)
3022: PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
3023:
3024: # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
3025: PHP_FE(dns_get_mx, arginfo_dns_get_mx)
3026: PHP_FALIAS(getmxrr, dns_get_mx, arginfo_dns_get_mx)
3027: PHP_FE(dns_get_record, arginfo_dns_get_record)
3028: # endif
3029: #endif
3030:
3031: /* functions from type.c */
3032: PHP_FE(intval, arginfo_intval)
3033: PHP_FE(floatval, arginfo_floatval)
3034: PHP_FALIAS(doubleval, floatval, arginfo_floatval)
3035: PHP_FE(strval, arginfo_strval)
3036: PHP_FE(gettype, arginfo_gettype)
3037: PHP_FE(settype, arginfo_settype)
3038: PHP_FE(is_null, arginfo_is_null)
3039: PHP_FE(is_resource, arginfo_is_resource)
3040: PHP_FE(is_bool, arginfo_is_bool)
3041: PHP_FE(is_long, arginfo_is_long)
3042: PHP_FE(is_float, arginfo_is_float)
3043: PHP_FALIAS(is_int, is_long, arginfo_is_long)
3044: PHP_FALIAS(is_integer, is_long, arginfo_is_long)
3045: PHP_FALIAS(is_double, is_float, arginfo_is_float)
3046: PHP_FALIAS(is_real, is_float, arginfo_is_float)
3047: PHP_FE(is_numeric, arginfo_is_numeric)
3048: PHP_FE(is_string, arginfo_is_string)
3049: PHP_FE(is_array, arginfo_is_array)
3050: PHP_FE(is_object, arginfo_is_object)
3051: PHP_FE(is_scalar, arginfo_is_scalar)
3052: PHP_FE(is_callable, arginfo_is_callable)
3053:
3054: /* functions from file.c */
3055: PHP_FE(pclose, arginfo_pclose)
3056: PHP_FE(popen, arginfo_popen)
3057: PHP_FE(readfile, arginfo_readfile)
3058: PHP_FE(rewind, arginfo_rewind)
3059: PHP_FE(rmdir, arginfo_rmdir)
3060: PHP_FE(umask, arginfo_umask)
3061: PHP_FE(fclose, arginfo_fclose)
3062: PHP_FE(feof, arginfo_feof)
3063: PHP_FE(fgetc, arginfo_fgetc)
3064: PHP_FE(fgets, arginfo_fgets)
3065: PHP_FE(fgetss, arginfo_fgetss)
3066: PHP_FE(fread, arginfo_fread)
3067: PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen)
3068: PHP_FE(fpassthru, arginfo_fpassthru)
3069: PHP_NAMED_FE(ftruncate, php_if_ftruncate, arginfo_ftruncate)
3070: PHP_NAMED_FE(fstat, php_if_fstat, arginfo_fstat)
3071: PHP_FE(fseek, arginfo_fseek)
3072: PHP_FE(ftell, arginfo_ftell)
3073: PHP_FE(fflush, arginfo_fflush)
3074: PHP_FE(fwrite, arginfo_fwrite)
3075: PHP_FALIAS(fputs, fwrite, arginfo_fwrite)
3076: PHP_FE(mkdir, arginfo_mkdir)
3077: PHP_FE(rename, arginfo_rename)
3078: PHP_FE(copy, arginfo_copy)
3079: PHP_FE(tempnam, arginfo_tempnam)
3080: PHP_NAMED_FE(tmpfile, php_if_tmpfile, arginfo_tmpfile)
3081: PHP_FE(file, arginfo_file)
3082: PHP_FE(file_get_contents, arginfo_file_get_contents)
3083: PHP_FE(file_put_contents, arginfo_file_put_contents)
3084: PHP_FE(stream_select, arginfo_stream_select)
3085: PHP_FE(stream_context_create, arginfo_stream_context_create)
3086: PHP_FE(stream_context_set_params, arginfo_stream_context_set_params)
3087: PHP_FE(stream_context_get_params, arginfo_stream_context_get_params)
3088: PHP_FE(stream_context_set_option, arginfo_stream_context_set_option)
3089: PHP_FE(stream_context_get_options, arginfo_stream_context_get_options)
3090: PHP_FE(stream_context_get_default, arginfo_stream_context_get_default)
3091: PHP_FE(stream_context_set_default, arginfo_stream_context_set_default)
3092: PHP_FE(stream_filter_prepend, arginfo_stream_filter_prepend)
3093: PHP_FE(stream_filter_append, arginfo_stream_filter_append)
3094: PHP_FE(stream_filter_remove, arginfo_stream_filter_remove)
3095: PHP_FE(stream_socket_client, arginfo_stream_socket_client)
3096: PHP_FE(stream_socket_server, arginfo_stream_socket_server)
3097: PHP_FE(stream_socket_accept, arginfo_stream_socket_accept)
3098: PHP_FE(stream_socket_get_name, arginfo_stream_socket_get_name)
3099: PHP_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom)
3100: PHP_FE(stream_socket_sendto, arginfo_stream_socket_sendto)
3101: PHP_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto)
3102: #ifdef HAVE_SHUTDOWN
3103: PHP_FE(stream_socket_shutdown, arginfo_stream_socket_shutdown)
3104: #endif
3105: #if HAVE_SOCKETPAIR
3106: PHP_FE(stream_socket_pair, arginfo_stream_socket_pair)
3107: #endif
3108: PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream)
3109: PHP_FE(stream_get_contents, arginfo_stream_get_contents)
3110: PHP_FE(stream_supports_lock, arginfo_stream_supports_lock)
3111: PHP_FE(fgetcsv, arginfo_fgetcsv)
3112: PHP_FE(fputcsv, arginfo_fputcsv)
3113: PHP_FE(flock, arginfo_flock)
3114: PHP_FE(get_meta_tags, arginfo_get_meta_tags)
3115: PHP_FE(stream_set_read_buffer, arginfo_stream_set_read_buffer)
3116: PHP_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer)
3117: PHP_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_stream_set_write_buffer)
3118:
3119: PHP_DEP_FALIAS(set_socket_blocking, stream_set_blocking, arginfo_stream_set_blocking)
3120: PHP_FE(stream_set_blocking, arginfo_stream_set_blocking)
3121: PHP_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_stream_set_blocking)
3122:
3123: PHP_FE(stream_get_meta_data, arginfo_stream_get_meta_data)
3124: PHP_FE(stream_get_line, arginfo_stream_get_line)
3125: PHP_FE(stream_wrapper_register, arginfo_stream_wrapper_register)
3126: PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_wrapper_register)
3127: PHP_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister)
3128: PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore)
3129: PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers)
3130: PHP_FE(stream_get_transports, arginfo_stream_get_transports)
3131: PHP_FE(stream_resolve_include_path, arginfo_stream_resolve_include_path)
3132: PHP_FE(stream_is_local, arginfo_stream_is_local)
3133: PHP_FE(get_headers, arginfo_get_headers)
3134:
3135: #if HAVE_SYS_TIME_H || defined(PHP_WIN32)
3136: PHP_FE(stream_set_timeout, arginfo_stream_set_timeout)
3137: PHP_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_stream_set_timeout)
3138: #endif
3139:
3140: PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
3141:
3142: #if (!defined(__BEOS__) && !defined(NETWARE) && HAVE_REALPATH) || defined(ZTS)
3143: PHP_FE(realpath, arginfo_realpath)
3144: #endif
3145:
3146: #ifdef HAVE_FNMATCH
3147: PHP_FE(fnmatch, arginfo_fnmatch)
3148: #endif
3149:
3150: /* functions from fsock.c */
3151: PHP_FE(fsockopen, arginfo_fsockopen)
3152: PHP_FE(pfsockopen, arginfo_pfsockopen)
3153:
3154: /* functions from pack.c */
3155: PHP_FE(pack, arginfo_pack)
3156: PHP_FE(unpack, arginfo_unpack)
3157:
3158: /* functions from browscap.c */
3159: PHP_FE(get_browser, arginfo_get_browser)
3160:
3161: #if HAVE_CRYPT
3162: /* functions from crypt.c */
3163: PHP_FE(crypt, arginfo_crypt)
3164: #endif
3165:
3166: /* functions from dir.c */
3167: PHP_FE(opendir, arginfo_opendir)
3168: PHP_FE(closedir, arginfo_closedir)
3169: PHP_FE(chdir, arginfo_chdir)
3170:
3171: #if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
3172: PHP_FE(chroot, arginfo_chroot)
3173: #endif
3174:
3175: PHP_FE(getcwd, arginfo_getcwd)
3176: PHP_FE(rewinddir, arginfo_rewinddir)
3177: PHP_NAMED_FE(readdir, php_if_readdir, arginfo_readdir)
3178: PHP_FALIAS(dir, getdir, arginfo_dir)
3179: PHP_FE(scandir, arginfo_scandir)
3180: #ifdef HAVE_GLOB
3181: PHP_FE(glob, arginfo_glob)
3182: #endif
3183: /* functions from filestat.c */
3184: PHP_FE(fileatime, arginfo_fileatime)
3185: PHP_FE(filectime, arginfo_filectime)
3186: PHP_FE(filegroup, arginfo_filegroup)
3187: PHP_FE(fileinode, arginfo_fileinode)
3188: PHP_FE(filemtime, arginfo_filemtime)
3189: PHP_FE(fileowner, arginfo_fileowner)
3190: PHP_FE(fileperms, arginfo_fileperms)
3191: PHP_FE(filesize, arginfo_filesize)
3192: PHP_FE(filetype, arginfo_filetype)
3193: PHP_FE(file_exists, arginfo_file_exists)
3194: PHP_FE(is_writable, arginfo_is_writable)
3195: PHP_FALIAS(is_writeable, is_writable, arginfo_is_writable)
3196: PHP_FE(is_readable, arginfo_is_readable)
3197: PHP_FE(is_executable, arginfo_is_executable)
3198: PHP_FE(is_file, arginfo_is_file)
3199: PHP_FE(is_dir, arginfo_is_dir)
3200: PHP_FE(is_link, arginfo_is_link)
3201: PHP_NAMED_FE(stat, php_if_stat, arginfo_stat)
3202: PHP_NAMED_FE(lstat, php_if_lstat, arginfo_lstat)
3203: #ifndef NETWARE
3204: PHP_FE(chown, arginfo_chown)
3205: PHP_FE(chgrp, arginfo_chgrp)
3206: #endif
3207: #if HAVE_LCHOWN
3208: PHP_FE(lchown, arginfo_lchown)
3209: #endif
3210: #if HAVE_LCHOWN
3211: PHP_FE(lchgrp, arginfo_lchgrp)
3212: #endif
3213: PHP_FE(chmod, arginfo_chmod)
3214: #if HAVE_UTIME
3215: PHP_FE(touch, arginfo_touch)
3216: #endif
3217: PHP_FE(clearstatcache, arginfo_clearstatcache)
3218: PHP_FE(disk_total_space, arginfo_disk_total_space)
3219: PHP_FE(disk_free_space, arginfo_disk_free_space)
3220: PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
3221: PHP_FE(realpath_cache_size, arginfo_realpath_cache_size)
3222: PHP_FE(realpath_cache_get, arginfo_realpath_cache_get)
3223:
3224: /* functions from mail.c */
3225: PHP_FE(mail, arginfo_mail)
3226: PHP_FE(ezmlm_hash, arginfo_ezmlm_hash)
3227:
3228: /* functions from syslog.c */
3229: #ifdef HAVE_SYSLOG_H
3230: PHP_FE(openlog, arginfo_openlog)
3231: PHP_FE(syslog, arginfo_syslog)
3232: PHP_FE(closelog, arginfo_closelog)
3233: PHP_DEP_FE(define_syslog_variables, arginfo_define_syslog_variables)
3234: #endif
3235:
3236: /* functions from lcg.c */
3237: PHP_FE(lcg_value, arginfo_lcg_value)
3238:
3239: /* functions from metaphone.c */
3240: PHP_FE(metaphone, arginfo_metaphone)
3241:
3242: /* functions from output.c */
3243: PHP_FE(ob_start, arginfo_ob_start)
3244: PHP_FE(ob_flush, arginfo_ob_flush)
3245: PHP_FE(ob_clean, arginfo_ob_clean)
3246: PHP_FE(ob_end_flush, arginfo_ob_end_flush)
3247: PHP_FE(ob_end_clean, arginfo_ob_end_clean)
3248: PHP_FE(ob_get_flush, arginfo_ob_get_flush)
3249: PHP_FE(ob_get_clean, arginfo_ob_get_clean)
3250: PHP_FE(ob_get_length, arginfo_ob_get_length)
3251: PHP_FE(ob_get_level, arginfo_ob_get_level)
3252: PHP_FE(ob_get_status, arginfo_ob_get_status)
3253: PHP_FE(ob_get_contents, arginfo_ob_get_contents)
3254: PHP_FE(ob_implicit_flush, arginfo_ob_implicit_flush)
3255: PHP_FE(ob_list_handlers, arginfo_ob_list_handlers)
3256:
3257: /* functions from array.c */
3258: PHP_FE(ksort, arginfo_ksort)
3259: PHP_FE(krsort, arginfo_krsort)
3260: PHP_FE(natsort, arginfo_natsort)
3261: PHP_FE(natcasesort, arginfo_natcasesort)
3262: PHP_FE(asort, arginfo_asort)
3263: PHP_FE(arsort, arginfo_arsort)
3264: PHP_FE(sort, arginfo_sort)
3265: PHP_FE(rsort, arginfo_rsort)
3266: PHP_FE(usort, arginfo_usort)
3267: PHP_FE(uasort, arginfo_uasort)
3268: PHP_FE(uksort, arginfo_uksort)
3269: PHP_FE(shuffle, arginfo_shuffle)
3270: PHP_FE(array_walk, arginfo_array_walk)
3271: PHP_FE(array_walk_recursive, arginfo_array_walk_recursive)
3272: PHP_FE(count, arginfo_count)
3273: PHP_FE(end, arginfo_end)
3274: PHP_FE(prev, arginfo_prev)
3275: PHP_FE(next, arginfo_next)
3276: PHP_FE(reset, arginfo_reset)
3277: PHP_FE(current, arginfo_current)
3278: PHP_FE(key, arginfo_key)
3279: PHP_FE(min, arginfo_min)
3280: PHP_FE(max, arginfo_max)
3281: PHP_FE(in_array, arginfo_in_array)
3282: PHP_FE(array_search, arginfo_array_search)
3283: PHP_FE(extract, arginfo_extract)
3284: PHP_FE(compact, arginfo_compact)
3285: PHP_FE(array_fill, arginfo_array_fill)
3286: PHP_FE(array_fill_keys, arginfo_array_fill_keys)
3287: PHP_FE(range, arginfo_range)
3288: PHP_FE(array_multisort, arginfo_array_multisort)
3289: PHP_FE(array_push, arginfo_array_push)
3290: PHP_FE(array_pop, arginfo_array_pop)
3291: PHP_FE(array_shift, arginfo_array_shift)
3292: PHP_FE(array_unshift, arginfo_array_unshift)
3293: PHP_FE(array_splice, arginfo_array_splice)
3294: PHP_FE(array_slice, arginfo_array_slice)
3295: PHP_FE(array_merge, arginfo_array_merge)
3296: PHP_FE(array_merge_recursive, arginfo_array_merge_recursive)
3297: PHP_FE(array_replace, arginfo_array_replace)
3298: PHP_FE(array_replace_recursive, arginfo_array_replace_recursive)
3299: PHP_FE(array_keys, arginfo_array_keys)
3300: PHP_FE(array_values, arginfo_array_values)
3301: PHP_FE(array_count_values, arginfo_array_count_values)
3302: PHP_FE(array_reverse, arginfo_array_reverse)
3303: PHP_FE(array_reduce, arginfo_array_reduce)
3304: PHP_FE(array_pad, arginfo_array_pad)
3305: PHP_FE(array_flip, arginfo_array_flip)
3306: PHP_FE(array_change_key_case, arginfo_array_change_key_case)
3307: PHP_FE(array_rand, arginfo_array_rand)
3308: PHP_FE(array_unique, arginfo_array_unique)
3309: PHP_FE(array_intersect, arginfo_array_intersect)
3310: PHP_FE(array_intersect_key, arginfo_array_intersect_key)
3311: PHP_FE(array_intersect_ukey, arginfo_array_intersect_ukey)
3312: PHP_FE(array_uintersect, arginfo_array_uintersect)
3313: PHP_FE(array_intersect_assoc, arginfo_array_intersect_assoc)
3314: PHP_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc)
3315: PHP_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc)
3316: PHP_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc)
3317: PHP_FE(array_diff, arginfo_array_diff)
3318: PHP_FE(array_diff_key, arginfo_array_diff_key)
3319: PHP_FE(array_diff_ukey, arginfo_array_diff_ukey)
3320: PHP_FE(array_udiff, arginfo_array_udiff)
3321: PHP_FE(array_diff_assoc, arginfo_array_diff_assoc)
3322: PHP_FE(array_udiff_assoc, arginfo_array_udiff_assoc)
3323: PHP_FE(array_diff_uassoc, arginfo_array_diff_uassoc)
3324: PHP_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc)
3325: PHP_FE(array_sum, arginfo_array_sum)
3326: PHP_FE(array_product, arginfo_array_product)
3327: PHP_FE(array_filter, arginfo_array_filter)
3328: PHP_FE(array_map, arginfo_array_map)
3329: PHP_FE(array_chunk, arginfo_array_chunk)
3330: PHP_FE(array_combine, arginfo_array_combine)
3331: PHP_FE(array_key_exists, arginfo_array_key_exists)
3332:
3333: /* aliases from array.c */
3334: PHP_FALIAS(pos, current, arginfo_current)
3335: PHP_FALIAS(sizeof, count, arginfo_count)
3336: PHP_FALIAS(key_exists, array_key_exists, arginfo_array_key_exists)
3337:
3338: /* functions from assert.c */
3339: PHP_FE(assert, arginfo_assert)
3340: PHP_FE(assert_options, arginfo_assert_options)
3341:
3342: /* functions from versioning.c */
3343: PHP_FE(version_compare, arginfo_version_compare)
3344:
3345: /* functions from ftok.c*/
3346: #if HAVE_FTOK
3347: PHP_FE(ftok, arginfo_ftok)
3348: #endif
3349:
3350: PHP_FE(str_rot13, arginfo_str_rot13)
3351: PHP_FE(stream_get_filters, arginfo_stream_get_filters)
3352: PHP_FE(stream_filter_register, arginfo_stream_filter_register)
3353: PHP_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable)
3354: PHP_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend)
3355: PHP_FE(stream_bucket_append, arginfo_stream_bucket_append)
3356: PHP_FE(stream_bucket_new, arginfo_stream_bucket_new)
3357:
3358: PHP_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var)
3359: PHP_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars)
3360:
3361: PHP_FE(sys_get_temp_dir, arginfo_sys_get_temp_dir)
3362:
3363: PHP_FE_END
3364: };
3365: /* }}} */
3366:
3367: static PHP_INI_MH(OnUpdateSafeModeProtectedEnvVars) /* {{{ */
3368: {
3369: char *protected_vars, *protected_var;
3370: char *token_buf;
3371: int dummy = 1;
3372:
3373: protected_vars = estrndup(new_value, new_value_length);
3374: zend_hash_clean(&BG(sm_protected_env_vars));
3375:
3376: protected_var = php_strtok_r(protected_vars, ", ", &token_buf);
3377: while (protected_var) {
3378: zend_hash_update(&BG(sm_protected_env_vars), protected_var, strlen(protected_var), &dummy, sizeof(int), NULL);
3379: protected_var = php_strtok_r(NULL, ", ", &token_buf);
3380: }
3381: efree(protected_vars);
3382: return SUCCESS;
3383: }
3384: /* }}} */
3385:
3386: static PHP_INI_MH(OnUpdateSafeModeAllowedEnvVars) /* {{{ */
3387: {
3388: if (BG(sm_allowed_env_vars)) {
3389: free(BG(sm_allowed_env_vars));
3390: }
3391: BG(sm_allowed_env_vars) = zend_strndup(new_value, new_value_length);
3392: return SUCCESS;
3393: }
3394: /* }}} */
3395:
3396: PHP_INI_BEGIN() /* {{{ */
3397: PHP_INI_ENTRY_EX("safe_mode_protected_env_vars", SAFE_MODE_PROTECTED_ENV_VARS, PHP_INI_SYSTEM, OnUpdateSafeModeProtectedEnvVars, NULL)
3398: PHP_INI_ENTRY_EX("safe_mode_allowed_env_vars", SAFE_MODE_ALLOWED_ENV_VARS, PHP_INI_SYSTEM, OnUpdateSafeModeAllowedEnvVars, NULL)
3399: PHP_INI_END()
3400: /* }}} */
3401:
3402: static const zend_module_dep standard_deps[] = { /* {{{ */
3403: ZEND_MOD_OPTIONAL("session")
3404: ZEND_MOD_END
3405: };
3406: /* }}} */
3407:
3408: zend_module_entry basic_functions_module = { /* {{{ */
3409: STANDARD_MODULE_HEADER_EX,
3410: NULL,
3411: standard_deps,
3412: "standard", /* extension name */
3413: basic_functions, /* function list */
3414: PHP_MINIT(basic), /* process startup */
3415: PHP_MSHUTDOWN(basic), /* process shutdown */
3416: PHP_RINIT(basic), /* request startup */
3417: PHP_RSHUTDOWN(basic), /* request shutdown */
3418: PHP_MINFO(basic), /* extension info */
3419: PHP_VERSION, /* extension version */
3420: STANDARD_MODULE_PROPERTIES
3421: };
3422: /* }}} */
3423:
3424: #if defined(HAVE_PUTENV)
3425: static void php_putenv_destructor(putenv_entry *pe) /* {{{ */
3426: {
3427: if (pe->previous_value) {
3428: #if _MSC_VER >= 1300
3429: /* VS.Net has a bug in putenv() when setting a variable that
3430: * is already set; if the SetEnvironmentVariable() API call
3431: * fails, the Crt will double free() a string.
3432: * We try to avoid this by setting our own value first */
3433: SetEnvironmentVariable(pe->key, "bugbug");
3434: #endif
3435: putenv(pe->previous_value);
3436: # if defined(PHP_WIN32) || __FreeBSD_version < 700050
3437: efree(pe->previous_value);
3438: # endif
3439: } else {
3440: # if HAVE_UNSETENV
3441: unsetenv(pe->key);
3442: # elif defined(PHP_WIN32)
3443: SetEnvironmentVariable(pe->key, NULL);
3444: # else
3445: char **env;
3446:
3447: for (env = environ; env != NULL && *env != NULL; env++) {
3448: if (!strncmp(*env, pe->key, pe->key_len) && (*env)[pe->key_len] == '=') { /* found it */
3449: *env = "";
3450: break;
3451: }
3452: }
3453: # endif
3454: }
3455: #ifdef HAVE_TZSET
3456: /* don't forget to reset the various libc globals that
3457: * we might have changed by an earlier call to tzset(). */
3458: if (!strncmp(pe->key, "TZ", pe->key_len)) {
3459: tzset();
3460: }
3461: #endif
3462:
3463: efree(pe->putenv_string);
3464: efree(pe->key);
3465: }
3466: /* }}} */
3467: #endif
3468:
3469: static void basic_globals_ctor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
3470: {
3471: BG(rand_is_seeded) = 0;
3472: BG(mt_rand_is_seeded) = 0;
3473: BG(umask) = -1;
3474: BG(next) = NULL;
3475: BG(left) = -1;
3476: BG(user_tick_functions) = NULL;
3477: BG(user_filter_map) = NULL;
3478: zend_hash_init(&BG(sm_protected_env_vars), 5, NULL, NULL, 1);
3479: BG(sm_allowed_env_vars) = NULL;
3480:
3481: memset(&BG(url_adapt_state_ex), 0, sizeof(BG(url_adapt_state_ex)));
3482:
3483: #if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
3484: memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
3485: #endif
3486:
3487: BG(incomplete_class) = incomplete_class_entry;
3488: BG(page_uid) = -1;
3489: BG(page_gid) = -1;
3490: }
3491: /* }}} */
3492:
3493: static void basic_globals_dtor(php_basic_globals *basic_globals_p TSRMLS_DC) /* {{{ */
3494: {
3495: zend_hash_destroy(&BG(sm_protected_env_vars));
3496: if (BG(sm_allowed_env_vars)) {
3497: free(BG(sm_allowed_env_vars));
3498: }
3499: if (BG(url_adapt_state_ex).tags) {
3500: zend_hash_destroy(BG(url_adapt_state_ex).tags);
3501: free(BG(url_adapt_state_ex).tags);
3502: }
3503: }
3504: /* }}} */
3505:
3506: #define PHP_DOUBLE_INFINITY_HIGH 0x7ff00000
3507: #define PHP_DOUBLE_QUIET_NAN_HIGH 0xfff80000
3508:
3509: PHPAPI double php_get_nan(void) /* {{{ */
3510: {
3511: #if HAVE_HUGE_VAL_NAN
3512: return HUGE_VAL + -HUGE_VAL;
3513: #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
3514: double val = 0.0;
3515: ((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
3516: ((php_uint32*)&val)[0] = 0;
3517: return val;
3518: #elif HAVE_ATOF_ACCEPTS_NAN
3519: return atof("NAN");
3520: #else
3521: return 0.0/0.0;
3522: #endif
3523: }
3524: /* }}} */
3525:
3526: PHPAPI double php_get_inf(void) /* {{{ */
3527: {
3528: #if HAVE_HUGE_VAL_INF
3529: return HUGE_VAL;
3530: #elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
3531: double val = 0.0;
3532: ((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH;
3533: ((php_uint32*)&val)[0] = 0;
3534: return val;
3535: #elif HAVE_ATOF_ACCEPTS_INF
3536: return atof("INF");
3537: #else
3538: return 1.0/0.0;
3539: #endif
3540: }
3541: /* }}} */
3542:
3543: PHP_MINIT_FUNCTION(basic) /* {{{ */
3544: {
3545: #ifdef ZTS
3546: ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
3547: #ifdef PHP_WIN32
3548: ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor)php_win32_core_globals_ctor, (ts_allocate_dtor)php_win32_core_globals_dtor );
3549: #endif
3550: #else
3551: basic_globals_ctor(&basic_globals TSRMLS_CC);
3552: #ifdef PHP_WIN32
3553: php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC);
3554: #endif
3555: #endif
3556:
3557: BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C);
3558:
3559: REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
3560: REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);
3561: REGISTER_LONG_CONSTANT("CONNECTION_TIMEOUT", PHP_CONNECTION_TIMEOUT, CONST_CS | CONST_PERSISTENT);
3562:
3563: REGISTER_LONG_CONSTANT("INI_USER", ZEND_INI_USER, CONST_CS | CONST_PERSISTENT);
3564: REGISTER_LONG_CONSTANT("INI_PERDIR", ZEND_INI_PERDIR, CONST_CS | CONST_PERSISTENT);
3565: REGISTER_LONG_CONSTANT("INI_SYSTEM", ZEND_INI_SYSTEM, CONST_CS | CONST_PERSISTENT);
3566: REGISTER_LONG_CONSTANT("INI_ALL", ZEND_INI_ALL, CONST_CS | CONST_PERSISTENT);
3567:
3568: REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_CS | CONST_PERSISTENT);
3569: REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_CS | CONST_PERSISTENT);
3570:
3571: REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS | CONST_PERSISTENT);
3572: REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS | CONST_PERSISTENT);
3573: REGISTER_LONG_CONSTANT("PHP_URL_PORT", PHP_URL_PORT, CONST_CS | CONST_PERSISTENT);
3574: REGISTER_LONG_CONSTANT("PHP_URL_USER", PHP_URL_USER, CONST_CS | CONST_PERSISTENT);
3575: REGISTER_LONG_CONSTANT("PHP_URL_PASS", PHP_URL_PASS, CONST_CS | CONST_PERSISTENT);
3576: REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_CS | CONST_PERSISTENT);
3577: REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_CS | CONST_PERSISTENT);
3578: REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_CS | CONST_PERSISTENT);
3579:
3580: #define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT)
3581: REGISTER_MATH_CONSTANT(M_E);
3582: REGISTER_MATH_CONSTANT(M_LOG2E);
3583: REGISTER_MATH_CONSTANT(M_LOG10E);
3584: REGISTER_MATH_CONSTANT(M_LN2);
3585: REGISTER_MATH_CONSTANT(M_LN10);
3586: REGISTER_MATH_CONSTANT(M_PI);
3587: REGISTER_MATH_CONSTANT(M_PI_2);
3588: REGISTER_MATH_CONSTANT(M_PI_4);
3589: REGISTER_MATH_CONSTANT(M_1_PI);
3590: REGISTER_MATH_CONSTANT(M_2_PI);
3591: REGISTER_MATH_CONSTANT(M_SQRTPI);
3592: REGISTER_MATH_CONSTANT(M_2_SQRTPI);
3593: REGISTER_MATH_CONSTANT(M_LNPI);
3594: REGISTER_MATH_CONSTANT(M_EULER);
3595: REGISTER_MATH_CONSTANT(M_SQRT2);
3596: REGISTER_MATH_CONSTANT(M_SQRT1_2);
3597: REGISTER_MATH_CONSTANT(M_SQRT3);
3598: REGISTER_DOUBLE_CONSTANT("INF", php_get_inf(), CONST_CS | CONST_PERSISTENT);
3599: REGISTER_DOUBLE_CONSTANT("NAN", php_get_nan(), CONST_CS | CONST_PERSISTENT);
3600:
3601: REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_UP", PHP_ROUND_HALF_UP, CONST_CS | CONST_PERSISTENT);
3602: REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_DOWN", PHP_ROUND_HALF_DOWN, CONST_CS | CONST_PERSISTENT);
3603: REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_EVEN", PHP_ROUND_HALF_EVEN, CONST_CS | CONST_PERSISTENT);
3604: REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_ODD", PHP_ROUND_HALF_ODD, CONST_CS | CONST_PERSISTENT);
3605:
3606: #if ENABLE_TEST_CLASS
3607: test_class_startup();
3608: #endif
3609:
3610: REGISTER_INI_ENTRIES();
3611:
3612: register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
3613: register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
3614: register_string_constants(INIT_FUNC_ARGS_PASSTHRU);
3615:
3616: PHP_MINIT(file)(INIT_FUNC_ARGS_PASSTHRU);
3617: PHP_MINIT(pack)(INIT_FUNC_ARGS_PASSTHRU);
3618: PHP_MINIT(browscap)(INIT_FUNC_ARGS_PASSTHRU);
3619: PHP_MINIT(standard_filters)(INIT_FUNC_ARGS_PASSTHRU);
3620: PHP_MINIT(user_filters)(INIT_FUNC_ARGS_PASSTHRU);
3621:
3622: #if defined(HAVE_LOCALECONV) && defined(ZTS)
3623: PHP_MINIT(localeconv)(INIT_FUNC_ARGS_PASSTHRU);
3624: #endif
3625:
3626: #if defined(HAVE_NL_LANGINFO)
3627: PHP_MINIT(nl_langinfo)(INIT_FUNC_ARGS_PASSTHRU);
3628: #endif
3629:
3630: #if HAVE_CRYPT
3631: PHP_MINIT(crypt)(INIT_FUNC_ARGS_PASSTHRU);
3632: #endif
3633:
3634: PHP_MINIT(lcg)(INIT_FUNC_ARGS_PASSTHRU);
3635:
3636: PHP_MINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
3637: #ifdef HAVE_SYSLOG_H
3638: PHP_MINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
3639: #endif
3640: PHP_MINIT(array)(INIT_FUNC_ARGS_PASSTHRU);
3641: PHP_MINIT(assert)(INIT_FUNC_ARGS_PASSTHRU);
3642: PHP_MINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
3643: #ifdef PHP_CAN_SUPPORT_PROC_OPEN
3644: PHP_MINIT(proc_open)(INIT_FUNC_ARGS_PASSTHRU);
3645: #endif
3646:
3647: PHP_MINIT(user_streams)(INIT_FUNC_ARGS_PASSTHRU);
3648: PHP_MINIT(imagetypes)(INIT_FUNC_ARGS_PASSTHRU);
3649:
3650: php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
3651: php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
3652: #ifdef HAVE_GLOB
3653: php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC);
3654: #endif
3655: php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
3656: #ifndef PHP_CURL_URL_WRAPPERS
3657: php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
3658: php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
3659: #endif
3660:
3661: #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
3662: # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
3663: PHP_MINIT(dns)(INIT_FUNC_ARGS_PASSTHRU);
3664: # endif
3665: #endif
3666:
3667: return SUCCESS;
3668: }
3669: /* }}} */
3670:
3671: PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
3672: {
3673: #ifdef HAVE_SYSLOG_H
3674: PHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3675: #endif
3676: #ifdef ZTS
3677: ts_free_id(basic_globals_id);
3678: #ifdef PHP_WIN32
3679: ts_free_id(php_win32_core_globals_id);
3680: #endif
3681: #else
3682: basic_globals_dtor(&basic_globals TSRMLS_CC);
3683: #ifdef PHP_WIN32
3684: php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC);
3685: #endif
3686: #endif
3687:
3688: php_unregister_url_stream_wrapper("php" TSRMLS_CC);
3689: #ifndef PHP_CURL_URL_WRAPPERS
3690: php_unregister_url_stream_wrapper("http" TSRMLS_CC);
3691: php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
3692: #endif
3693:
3694: UNREGISTER_INI_ENTRIES();
3695:
3696: PHP_MSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3697: PHP_MSHUTDOWN(array)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3698: PHP_MSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3699: PHP_MSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3700: PHP_MSHUTDOWN(file)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3701: PHP_MSHUTDOWN(standard_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3702: #if defined(HAVE_LOCALECONV) && defined(ZTS)
3703: PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3704: #endif
3705: #if HAVE_CRYPT
3706: PHP_MSHUTDOWN(crypt)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3707: #endif
3708:
3709: return SUCCESS;
3710: }
3711: /* }}} */
3712:
3713: PHP_RINIT_FUNCTION(basic) /* {{{ */
3714: {
3715: memset(BG(strtok_table), 0, 256);
3716: BG(strtok_string) = NULL;
3717: BG(strtok_zval) = NULL;
3718: BG(strtok_last) = NULL;
3719: BG(locale_string) = NULL;
3720: BG(array_walk_fci) = empty_fcall_info;
3721: BG(array_walk_fci_cache) = empty_fcall_info_cache;
3722: BG(user_compare_fci) = empty_fcall_info;
3723: BG(user_compare_fci_cache) = empty_fcall_info_cache;
3724: BG(page_uid) = -1;
3725: BG(page_gid) = -1;
3726: BG(page_inode) = -1;
3727: BG(page_mtime) = -1;
3728: #ifdef HAVE_PUTENV
3729: if (zend_hash_init(&BG(putenv_ht), 1, NULL, (void (*)(void *)) php_putenv_destructor, 0) == FAILURE) {
3730: return FAILURE;
3731: }
3732: #endif
3733: BG(user_shutdown_function_names) = NULL;
3734:
3735: PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
3736: #ifdef HAVE_SYSLOG_H
3737: PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
3738: #endif
3739: PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
3740: PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
3741:
3742: /* Reset magic_quotes_runtime */
3743: PG(magic_quotes_runtime) = INI_BOOL("magic_quotes_runtime");
3744:
3745: /* Setup default context */
3746: FG(default_context) = NULL;
3747:
3748: /* Default to global wrappers only */
3749: FG(stream_wrappers) = NULL;
3750:
3751: /* Default to global filters only */
3752: FG(stream_filters) = NULL;
3753:
3754: return SUCCESS;
3755: }
3756: /* }}} */
3757:
3758: PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */
3759: {
3760: if (BG(strtok_zval)) {
3761: zval_ptr_dtor(&BG(strtok_zval));
3762: }
3763: BG(strtok_string) = NULL;
3764: BG(strtok_zval) = NULL;
3765: #ifdef HAVE_PUTENV
3766: zend_hash_destroy(&BG(putenv_ht));
3767: #endif
3768:
3769: if (BG(umask) != -1) {
3770: umask(BG(umask));
3771: }
3772:
3773: /* Check if locale was changed and change it back
3774: * to the value in startup environment */
3775: if (BG(locale_string) != NULL) {
3776: setlocale(LC_ALL, "C");
3777: setlocale(LC_CTYPE, "");
3778: zend_update_current_locale();
3779: }
3780: STR_FREE(BG(locale_string));
3781: BG(locale_string) = NULL;
3782:
3783: /* FG(stream_wrappers) and FG(stream_filters) are destroyed
3784: * during php_request_shutdown() */
3785:
3786: PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3787: #ifdef HAVE_SYSLOG_H
3788: #ifdef PHP_WIN32
3789: PHP_RSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3790: #endif
3791: #endif
3792: PHP_RSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3793: PHP_RSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3794: PHP_RSHUTDOWN(streams)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3795: #ifdef PHP_WIN32
3796: PHP_RSHUTDOWN(win32_core_globals)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3797: #endif
3798:
3799: if (BG(user_tick_functions)) {
3800: zend_llist_destroy(BG(user_tick_functions));
3801: efree(BG(user_tick_functions));
3802: BG(user_tick_functions) = NULL;
3803: }
3804:
3805: PHP_RSHUTDOWN(user_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3806: PHP_RSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
3807:
3808: BG(page_uid) = -1;
3809: BG(page_gid) = -1;
3810: return SUCCESS;
3811: }
3812: /* }}} */
3813:
3814: PHP_MINFO_FUNCTION(basic) /* {{{ */
3815: {
3816: php_info_print_table_start();
3817: PHP_MINFO(dl)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
3818: PHP_MINFO(mail)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
3819: php_info_print_table_end();
3820: PHP_MINFO(assert)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
3821: }
3822: /* }}} */
3823:
3824: /* {{{ proto mixed constant(string const_name)
3825: Given the name of a constant this function will return the constant's associated value */
3826: PHP_FUNCTION(constant)
3827: {
3828: char *const_name;
3829: int const_name_len;
3830:
3831: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &const_name, &const_name_len) == FAILURE) {
3832: return;
3833: }
3834:
3835: if (!zend_get_constant_ex(const_name, const_name_len, return_value, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC)) {
3836: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", const_name);
3837: RETURN_NULL();
3838: }
3839: }
3840: /* }}} */
3841:
3842: #ifdef HAVE_INET_NTOP
3843: /* {{{ proto string inet_ntop(string in_addr)
3844: Converts a packed inet address to a human readable IP address string */
3845: PHP_NAMED_FUNCTION(php_inet_ntop)
3846: {
3847: char *address;
3848: int address_len, af = AF_INET;
3849: char buffer[40];
3850:
3851: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
3852: RETURN_FALSE;
3853: }
3854:
3855: #ifdef HAVE_IPV6
3856: if (address_len == 16) {
3857: af = AF_INET6;
3858: } else
3859: #endif
3860: if (address_len != 4) {
3861: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid in_addr value");
3862: RETURN_FALSE;
3863: }
3864:
3865: if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
3866: php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occured");
3867: RETURN_FALSE;
3868: }
3869:
3870: RETURN_STRING(buffer, 1);
3871: }
3872: /* }}} */
3873: #endif /* HAVE_INET_NTOP */
3874:
3875: #ifdef HAVE_INET_PTON
3876: /* {{{ proto string inet_pton(string ip_address)
3877: Converts a human readable IP address to a packed binary string */
3878: PHP_NAMED_FUNCTION(php_inet_pton)
3879: {
3880: int ret, af = AF_INET;
3881: char *address;
3882: int address_len;
3883: char buffer[17];
3884:
3885: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &address, &address_len) == FAILURE) {
3886: RETURN_FALSE;
3887: }
3888:
3889: memset(buffer, 0, sizeof(buffer));
3890:
3891: #ifdef HAVE_IPV6
3892: if (strchr(address, ':')) {
3893: af = AF_INET6;
3894: } else
3895: #endif
3896: if (!strchr(address, '.')) {
3897: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
3898: RETURN_FALSE;
3899: }
3900:
3901: ret = inet_pton(af, address, buffer);
3902:
3903: if (ret <= 0) {
3904: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized address %s", address);
3905: RETURN_FALSE;
3906: }
3907:
3908: RETURN_STRINGL(buffer, af == AF_INET ? 4 : 16, 1);
3909: }
3910: /* }}} */
3911: #endif /* HAVE_INET_PTON */
3912:
3913: /* {{{ proto int ip2long(string ip_address)
3914: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address */
3915: PHP_FUNCTION(ip2long)
3916: {
3917: char *addr;
3918: int addr_len;
3919: #ifdef HAVE_INET_PTON
3920: struct in_addr ip;
3921: #else
3922: unsigned long int ip;
3923: #endif
3924:
3925: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
3926: return;
3927: }
3928:
3929: #ifdef HAVE_INET_PTON
3930: if (addr_len == 0 || inet_pton(AF_INET, addr, &ip) != 1) {
3931: RETURN_FALSE;
3932: }
3933: RETURN_LONG(ntohl(ip.s_addr));
3934: #else
3935: if (addr_len == 0 || (ip = inet_addr(addr)) == INADDR_NONE) {
3936: /* The only special case when we should return -1 ourselves,
3937: * because inet_addr() considers it wrong. We return 0xFFFFFFFF and
3938: * not -1 or ~0 because of 32/64bit issues. */
3939: if (addr_len == sizeof("255.255.255.255") - 1 &&
3940: !memcmp(addr, "255.255.255.255", sizeof("255.255.255.255") - 1)
3941: ) {
3942: RETURN_LONG(0xFFFFFFFF);
3943: }
3944: RETURN_FALSE;
3945: }
3946: RETURN_LONG(ntohl(ip));
3947: #endif
3948: }
3949: /* }}} */
3950:
3951: /* {{{ proto string long2ip(int proper_address)
3952: Converts an (IPv4) Internet network address into a string in Internet standard dotted format */
3953: PHP_FUNCTION(long2ip)
3954: {
3955: /* "It's a long but it's not, PHP ints are signed */
3956: char *ip;
3957: int ip_len;
3958: unsigned long n;
3959: struct in_addr myaddr;
3960: #ifdef HAVE_INET_PTON
3961: char str[40];
3962: #endif
3963:
3964: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ip, &ip_len) == FAILURE) {
3965: return;
3966: }
3967:
3968: n = strtoul(ip, NULL, 0);
3969:
3970: myaddr.s_addr = htonl(n);
3971: #ifdef HAVE_INET_PTON
3972: if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
3973: RETURN_STRING(str, 1);
3974: } else {
3975: RETURN_FALSE;
3976: }
3977: #else
3978: RETURN_STRING(inet_ntoa(myaddr), 1);
3979: #endif
3980: }
3981: /* }}} */
3982:
3983: /********************
3984: * System Functions *
3985: ********************/
3986:
3987: /* {{{ proto string getenv(string varname)
3988: Get the value of an environment variable */
3989: PHP_FUNCTION(getenv)
3990: {
3991: char *ptr, *str;
3992: int str_len;
3993:
3994: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
3995: RETURN_FALSE;
3996: }
3997:
3998: /* SAPI method returns an emalloc()'d string */
3999: ptr = sapi_getenv(str, str_len TSRMLS_CC);
4000: if (ptr) {
4001: RETURN_STRING(ptr, 0);
4002: }
4003: #ifdef PHP_WIN32
4004: {
4005: char dummybuf;
4006: int size;
4007:
4008: SetLastError(0);
4009: /*If the given bugger is not large enough to hold the data, the return value is
4010: the buffer size, in characters, required to hold the string and its terminating
4011: null character. We use this return value to alloc the final buffer. */
4012: size = GetEnvironmentVariableA(str, &dummybuf, 0);
4013: if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
4014: /* The environment variable doesn't exist. */
4015: RETURN_FALSE;
4016: }
4017:
4018: if (size == 0) {
4019: /* env exists, but it is empty */
4020: RETURN_EMPTY_STRING();
4021: }
4022:
4023: ptr = emalloc(size);
4024: size = GetEnvironmentVariableA(str, ptr, size);
4025: if (size == 0) {
4026: /* has been removed between the two calls */
4027: efree(ptr);
4028: RETURN_EMPTY_STRING();
4029: } else {
4030: RETURN_STRING(ptr, 0);
4031: }
4032: }
4033: #else
4034: /* system method returns a const */
4035: ptr = getenv(str);
4036: if (ptr) {
4037: RETURN_STRING(ptr, 1);
4038: }
4039: #endif
4040: RETURN_FALSE;
4041: }
4042: /* }}} */
4043:
4044: #ifdef HAVE_PUTENV
4045: /* {{{ proto bool putenv(string setting)
4046: Set the value of an environment variable */
4047: PHP_FUNCTION(putenv)
4048: {
4049: char *setting;
4050: int setting_len;
4051:
4052: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &setting, &setting_len) == FAILURE) {
4053: return;
4054: }
4055:
4056: if (setting_len) {
4057: char *p, **env;
4058: putenv_entry pe;
4059: #ifdef PHP_WIN32
4060: char *value = NULL;
4061: int equals = 0;
4062: int error_code;
4063: #endif
4064:
4065: pe.putenv_string = estrndup(setting, setting_len);
4066: pe.key = estrndup(setting, setting_len);
4067: if ((p = strchr(pe.key, '='))) { /* nullify the '=' if there is one */
4068: *p = '\0';
4069: #ifdef PHP_WIN32
4070: equals = 1;
4071: #endif
4072: }
4073:
4074: pe.key_len = strlen(pe.key);
4075: #ifdef PHP_WIN32
4076: if (equals) {
4077: if (pe.key_len < setting_len - 1) {
4078: value = p + 1;
4079: } else {
4080: /* empty string*/
4081: value = p;
4082: }
4083: }
4084: #endif
4085:
4086: if (PG(safe_mode)) {
4087: /* Check the protected list */
4088: if (zend_hash_exists(&BG(sm_protected_env_vars), pe.key, pe.key_len)) {
4089: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Safe Mode warning: Cannot override protected environment variable '%s'", pe.key);
4090: efree(pe.putenv_string);
4091: efree(pe.key);
4092: RETURN_FALSE;
4093: }
4094:
4095: /* Check the allowed list */
4096: if (BG(sm_allowed_env_vars) && *BG(sm_allowed_env_vars)) {
4097: char *allowed_env_vars = estrdup(BG(sm_allowed_env_vars));
4098: char *strtok_buf = NULL;
4099: char *allowed_prefix = php_strtok_r(allowed_env_vars, ", ", &strtok_buf);
4100: zend_bool allowed = 0;
4101:
4102: while (allowed_prefix) {
4103: if (!strncmp(allowed_prefix, pe.key, strlen(allowed_prefix))) {
4104: allowed = 1;
4105: break;
4106: }
4107: allowed_prefix = php_strtok_r(NULL, ", ", &strtok_buf);
4108: }
4109: efree(allowed_env_vars);
4110: if (!allowed) {
4111: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Safe Mode warning: Cannot set environment variable '%s' - it's not in the allowed list", pe.key);
4112: efree(pe.putenv_string);
4113: efree(pe.key);
4114: RETURN_FALSE;
4115: }
4116: }
4117: }
4118:
4119: zend_hash_del(&BG(putenv_ht), pe.key, pe.key_len+1);
4120:
4121: /* find previous value */
4122: pe.previous_value = NULL;
4123: for (env = environ; env != NULL && *env != NULL; env++) {
4124: if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /* found it */
4125: #if defined(PHP_WIN32) || __FreeBSD_version < 700050
4126: /* must copy previous value because MSVCRT's putenv can free the string without notice */
4127: pe.previous_value = estrdup(*env);
4128: #else
4129: pe.previous_value = *env;
4130: #endif
4131: break;
4132: }
4133: }
4134:
4135: #if HAVE_UNSETENV
4136: if (!p) { /* no '=' means we want to unset it */
4137: unsetenv(pe.putenv_string);
4138: }
4139: if (!p || putenv(pe.putenv_string) == 0) { /* success */
4140: #else
4141: # ifndef PHP_WIN32
4142: if (putenv(pe.putenv_string) == 0) { /* success */
4143: # else
4144: error_code = SetEnvironmentVariable(pe.key, value);
4145: # if _MSC_VER < 1500
4146: /* Yet another VC6 bug, unset may return env not found */
4147: if (error_code != 0 ||
4148: (error_code == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)) {
4149: # else
4150: if (error_code != 0) { /* success */
4151: # endif
4152: # endif
4153: #endif
4154: zend_hash_add(&BG(putenv_ht), pe.key, pe.key_len + 1, (void **) &pe, sizeof(putenv_entry), NULL);
4155: #ifdef HAVE_TZSET
4156: if (!strncmp(pe.key, "TZ", pe.key_len)) {
4157: tzset();
4158: }
4159: #endif
4160: RETURN_TRUE;
4161: } else {
4162: efree(pe.putenv_string);
4163: efree(pe.key);
4164: RETURN_FALSE;
4165: }
4166: }
4167:
4168: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter syntax");
4169: RETURN_FALSE;
4170: }
4171: /* }}} */
4172: #endif
4173:
4174: /* {{{ free_argv()
4175: Free the memory allocated to an argv array. */
4176: static void free_argv(char **argv, int argc)
4177: {
4178: int i;
4179:
4180: if (argv) {
4181: for (i = 0; i < argc; i++) {
4182: if (argv[i]) {
4183: efree(argv[i]);
4184: }
4185: }
4186: efree(argv);
4187: }
4188: }
4189: /* }}} */
4190:
4191: /* {{{ free_longopts()
4192: Free the memory allocated to an longopt array. */
4193: static void free_longopts(opt_struct *longopts)
4194: {
4195: opt_struct *p;
4196:
4197: if (longopts) {
4198: for (p = longopts; p && p->opt_char != '-'; p++) {
4199: if (p->opt_name != NULL) {
4200: efree((char *)(p->opt_name));
4201: }
4202: }
4203: }
4204: }
4205: /* }}} */
4206:
4207: /* {{{ parse_opts()
4208: Convert the typical getopt input characters to the php_getopt struct array */
4209: static int parse_opts(char * opts, opt_struct ** result)
4210: {
4211: opt_struct * paras = NULL;
4212: unsigned int i, count = 0;
4213:
4214: for (i = 0; i < strlen(opts); i++) {
4215: if ((opts[i] >= 48 && opts[i] <= 57) ||
4216: (opts[i] >= 65 && opts[i] <= 90) ||
4217: (opts[i] >= 97 && opts[i] <= 122)
4218: ) {
4219: count++;
4220: }
4221: }
4222:
4223: paras = safe_emalloc(sizeof(opt_struct), count, 0);
4224: memset(paras, 0, sizeof(opt_struct) * count);
4225: *result = paras;
4226: while ( (*opts >= 48 && *opts <= 57) || /* 0 - 9 */
4227: (*opts >= 65 && *opts <= 90) || /* A - Z */
4228: (*opts >= 97 && *opts <= 122) /* a - z */
4229: ) {
4230: paras->opt_char = *opts;
4231: paras->need_param = (*(++opts) == ':') ? 1 : 0;
4232: paras->opt_name = NULL;
4233: if (paras->need_param == 1) {
4234: opts++;
4235: if (*opts == ':') {
4236: paras->need_param++;
4237: opts++;
4238: }
4239: }
4240: paras++;
4241: }
4242: return count;
4243: }
4244: /* }}} */
4245:
4246: /* {{{ proto array getopt(string options [, array longopts])
4247: Get options from the command line argument list */
4248: PHP_FUNCTION(getopt)
4249: {
4250: char *options = NULL, **argv = NULL;
4251: char opt[2] = { '\0' };
4252: char *optname;
4253: int argc = 0, options_len = 0, len, o;
4254: char *php_optarg = NULL;
4255: int php_optind = 1;
4256: zval *val, **args = NULL, *p_longopts = NULL;
4257: int optname_len = 0;
4258: opt_struct *opts, *orig_opts;
4259:
4260: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &options, &options_len, &p_longopts) == FAILURE) {
4261: RETURN_FALSE;
4262: }
4263:
4264: /* Get argv from the global symbol table. We calculate argc ourselves
4265: * in order to be on the safe side, even though it is also available
4266: * from the symbol table. */
4267: if (PG(http_globals)[TRACK_VARS_SERVER] &&
4268: (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE ||
4269: zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) && Z_TYPE_PP(args) == IS_ARRAY
4270: ) {
4271: int pos = 0;
4272: zval **entry;
4273:
4274: argc = zend_hash_num_elements(Z_ARRVAL_PP(args));
4275:
4276: /* Attempt to allocate enough memory to hold all of the arguments
4277: * and a trailing NULL */
4278: argv = (char **) safe_emalloc(sizeof(char *), (argc + 1), 0);
4279:
4280: /* Reset the array indexes. */
4281: zend_hash_internal_pointer_reset(Z_ARRVAL_PP(args));
4282:
4283: /* Iterate over the hash to construct the argv array. */
4284: while (zend_hash_get_current_data(Z_ARRVAL_PP(args), (void **)&entry) == SUCCESS) {
4285: zval arg, *arg_ptr = *entry;
4286:
4287: if (Z_TYPE_PP(entry) != IS_STRING) {
4288: arg = **entry;
4289: zval_copy_ctor(&arg);
4290: convert_to_string(&arg);
4291: arg_ptr = &arg;
4292: }
4293:
4294: argv[pos++] = estrdup(Z_STRVAL_P(arg_ptr));
4295:
4296: if (arg_ptr != *entry) {
4297: zval_dtor(&arg);
4298: }
4299:
4300: zend_hash_move_forward(Z_ARRVAL_PP(args));
4301: }
4302:
4303: /* The C Standard requires argv[argc] to be NULL - this might
4304: * keep some getopt implementations happy. */
4305: argv[argc] = NULL;
4306: } else {
4307: /* Return false if we can't find argv. */
4308: RETURN_FALSE;
4309: }
4310:
4311: len = parse_opts(options, &opts);
4312:
4313: if (p_longopts) {
4314: int count;
4315: zval **entry;
4316:
4317: count = zend_hash_num_elements(Z_ARRVAL_P(p_longopts));
4318:
4319: /* the first <len> slots are filled by the one short ops
4320: * we now extend our array and jump to the new added structs */
4321: opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1));
4322: orig_opts = opts;
4323: opts += len;
4324:
4325: memset(opts, 0, count * sizeof(opt_struct));
4326:
4327: /* Reset the array indexes. */
4328: zend_hash_internal_pointer_reset(Z_ARRVAL_P(p_longopts));
4329:
4330: /* Iterate over the hash to construct the argv array. */
4331: while (zend_hash_get_current_data(Z_ARRVAL_P(p_longopts), (void **)&entry) == SUCCESS) {
4332: zval arg, *arg_ptr = *entry;
4333:
4334: if (Z_TYPE_PP(entry) != IS_STRING) {
4335: arg = **entry;
4336: zval_copy_ctor(&arg);
4337: convert_to_string(&arg);
4338: arg_ptr = &arg;
4339: }
4340:
4341: opts->need_param = 0;
4342: opts->opt_name = estrdup(Z_STRVAL_P(arg_ptr));
4343: len = strlen(opts->opt_name);
4344: if ((len > 0) && (opts->opt_name[len - 1] == ':')) {
4345: opts->need_param++;
4346: opts->opt_name[len - 1] = '\0';
4347: if ((len > 1) && (opts->opt_name[len - 2] == ':')) {
4348: opts->need_param++;
4349: opts->opt_name[len - 2] = '\0';
4350: }
4351: }
4352: opts->opt_char = 0;
4353: opts++;
4354:
4355: if (arg_ptr != *entry) {
4356: zval_dtor(&arg);
4357: }
4358:
4359: zend_hash_move_forward(Z_ARRVAL_P(p_longopts));
4360: }
4361: } else {
4362: opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
4363: orig_opts = opts;
4364: opts += len;
4365: }
4366:
4367: /* php_getopt want to identify the last param */
4368: opts->opt_char = '-';
4369: opts->need_param = 0;
4370: opts->opt_name = NULL;
4371:
4372: /* Initialize the return value as an array. */
4373: array_init(return_value);
4374:
4375: /* after our pointer arithmetic jump back to the first element */
4376: opts = orig_opts;
4377:
4378: while ((o = php_getopt(argc, argv, opts, &php_optarg, &php_optind, 0, 1)) != -1) {
4379: /* Skip unknown arguments. */
4380: if (o == '?') {
4381: continue;
4382: }
4383:
4384: /* Prepare the option character and the argument string. */
4385: if (o == 0) {
4386: optname = opts[php_optidx].opt_name;
4387: } else {
4388: if (o == 1) {
4389: o = '-';
4390: }
4391: opt[0] = o;
4392: optname = opt;
4393: }
4394:
4395: MAKE_STD_ZVAL(val);
4396: if (php_optarg != NULL) {
4397: /* keep the arg as binary, since the encoding is not known */
4398: ZVAL_STRING(val, php_optarg, 1);
4399: } else {
4400: ZVAL_FALSE(val);
4401: }
4402:
4403: /* Add this option / argument pair to the result hash. */
4404: optname_len = strlen(optname);
4405: if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) {
4406: /* numeric string */
4407: int optname_int = atoi(optname);
4408: if (zend_hash_index_find(HASH_OF(return_value), optname_int, (void **)&args) != FAILURE) {
4409: if (Z_TYPE_PP(args) != IS_ARRAY) {
4410: convert_to_array_ex(args);
4411: }
4412: zend_hash_next_index_insert(HASH_OF(*args), (void *)&val, sizeof(zval *), NULL);
4413: } else {
4414: zend_hash_index_update(HASH_OF(return_value), optname_int, &val, sizeof(zval *), NULL);
4415: }
4416: } else {
4417: /* other strings */
4418: if (zend_hash_find(HASH_OF(return_value), optname, strlen(optname)+1, (void **)&args) != FAILURE) {
4419: if (Z_TYPE_PP(args) != IS_ARRAY) {
4420: convert_to_array_ex(args);
4421: }
4422: zend_hash_next_index_insert(HASH_OF(*args), (void *)&val, sizeof(zval *), NULL);
4423: } else {
4424: zend_hash_add(HASH_OF(return_value), optname, strlen(optname)+1, (void *)&val, sizeof(zval *), NULL);
4425: }
4426: }
4427:
4428: php_optarg = NULL;
4429: }
4430:
4431: free_longopts(orig_opts);
4432: efree(orig_opts);
4433: free_argv(argv, argc);
4434: }
4435: /* }}} */
4436:
4437: /* {{{ proto void flush(void)
4438: Flush the output buffer */
4439: PHP_FUNCTION(flush)
4440: {
4441: sapi_flush(TSRMLS_C);
4442: }
4443: /* }}} */
4444:
4445: /* {{{ proto void sleep(int seconds)
4446: Delay for a given number of seconds */
4447: PHP_FUNCTION(sleep)
4448: {
4449: long num;
4450:
4451: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
4452: RETURN_FALSE;
4453: }
4454: if (num < 0) {
4455: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of seconds must be greater than or equal to 0");
4456: RETURN_FALSE;
4457: }
4458: #ifdef PHP_SLEEP_NON_VOID
4459: RETURN_LONG(php_sleep(num));
4460: #else
4461: php_sleep(num);
4462: #endif
4463:
4464: }
4465: /* }}} */
4466:
4467: /* {{{ proto void usleep(int micro_seconds)
4468: Delay for a given number of micro seconds */
4469: PHP_FUNCTION(usleep)
4470: {
4471: #if HAVE_USLEEP
4472: long num;
4473:
4474: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
4475: return;
4476: }
4477: if (num < 0) {
4478: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0");
4479: RETURN_FALSE;
4480: }
4481: usleep(num);
4482: #endif
4483: }
4484: /* }}} */
4485:
4486: #if HAVE_NANOSLEEP
4487: /* {{{ proto mixed time_nanosleep(long seconds, long nanoseconds)
4488: Delay for a number of seconds and nano seconds */
4489: PHP_FUNCTION(time_nanosleep)
4490: {
4491: long tv_sec, tv_nsec;
4492: struct timespec php_req, php_rem;
4493:
4494: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &tv_sec, &tv_nsec) == FAILURE) {
4495: return;
4496: }
4497:
4498: php_req.tv_sec = (time_t) tv_sec;
4499: php_req.tv_nsec = tv_nsec;
4500: if (!nanosleep(&php_req, &php_rem)) {
4501: RETURN_TRUE;
4502: } else if (errno == EINTR) {
4503: array_init(return_value);
4504: add_assoc_long_ex(return_value, "seconds", sizeof("seconds"), php_rem.tv_sec);
4505: add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds"), php_rem.tv_nsec);
4506: return;
4507: } else if (errno == EINVAL) {
4508: php_error_docref(NULL TSRMLS_CC, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
4509: }
4510:
4511: RETURN_FALSE;
4512: }
4513: /* }}} */
4514:
4515: /* {{{ proto mixed time_sleep_until(float timestamp)
4516: Make the script sleep until the specified time */
4517: PHP_FUNCTION(time_sleep_until)
4518: {
4519: double d_ts, c_ts;
4520: struct timeval tm;
4521: struct timespec php_req, php_rem;
4522:
4523: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &d_ts) == FAILURE) {
4524: return;
4525: }
4526:
4527: if (gettimeofday((struct timeval *) &tm, NULL) != 0) {
4528: RETURN_FALSE;
4529: }
4530:
4531: c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00);
4532: if (c_ts < 0) {
4533: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sleep until to time is less than current time");
4534: RETURN_FALSE;
4535: }
4536:
4537: php_req.tv_sec = (time_t) c_ts;
4538: if (php_req.tv_sec > c_ts) { /* rounding up occurred */
4539: php_req.tv_sec--;
4540: }
4541: /* 1sec = 1000000000 nanoseconds */
4542: php_req.tv_nsec = (long) ((c_ts - php_req.tv_sec) * 1000000000.00);
4543:
4544: while (nanosleep(&php_req, &php_rem)) {
4545: if (errno == EINTR) {
4546: php_req.tv_sec = php_rem.tv_sec;
4547: php_req.tv_nsec = php_rem.tv_nsec;
4548: } else {
4549: RETURN_FALSE;
4550: }
4551: }
4552:
4553: RETURN_TRUE;
4554: }
4555: /* }}} */
4556: #endif
4557:
4558: /* {{{ proto string get_current_user(void)
4559: Get the name of the owner of the current PHP script */
4560: PHP_FUNCTION(get_current_user)
4561: {
4562: if (zend_parse_parameters_none() == FAILURE) {
4563: return;
4564: }
4565:
4566: RETURN_STRING(php_get_current_user(), 1);
4567: }
4568: /* }}} */
4569:
4570: /* {{{ add_config_entry_cb
4571: */
4572: static int add_config_entry_cb(zval *entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
4573: {
4574: zval *retval = (zval *)va_arg(args, zval*);
4575: zval *tmp;
4576:
4577: if (Z_TYPE_P(entry) == IS_STRING) {
4578: if (hash_key->nKeyLength > 0) {
4579: add_assoc_stringl_ex(retval, hash_key->arKey, hash_key->nKeyLength, Z_STRVAL_P(entry), Z_STRLEN_P(entry), 1);
4580: } else {
4581: add_index_stringl(retval, hash_key->h, Z_STRVAL_P(entry), Z_STRLEN_P(entry), 1);
4582: }
4583: } else if (Z_TYPE_P(entry) == IS_ARRAY) {
4584: MAKE_STD_ZVAL(tmp);
4585: array_init(tmp);
4586: zend_hash_apply_with_arguments(Z_ARRVAL_P(entry) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, tmp);
4587: add_assoc_zval_ex(retval, hash_key->arKey, hash_key->nKeyLength, tmp);
4588: }
4589: return 0;
4590: }
4591: /* }}} */
4592:
4593: /* {{{ proto mixed get_cfg_var(string option_name)
4594: Get the value of a PHP configuration option */
4595: PHP_FUNCTION(get_cfg_var)
4596: {
4597: char *varname;
4598: int varname_len;
4599: zval *retval;
4600:
4601: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
4602: return;
4603: }
4604:
4605: retval = cfg_get_entry(varname, varname_len + 1);
4606:
4607: if (retval) {
4608: if (Z_TYPE_P(retval) == IS_ARRAY) {
4609: array_init(return_value);
4610: zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
4611: return;
4612: } else {
4613: RETURN_STRING(Z_STRVAL_P(retval), 1);
4614: }
4615: } else {
4616: RETURN_FALSE;
4617: }
4618: }
4619: /* }}} */
4620:
4621: /* {{{ proto bool set_magic_quotes_runtime(int new_setting)
4622: Set the current active configuration setting of magic_quotes_runtime and return previous */
4623: PHP_FUNCTION(set_magic_quotes_runtime)
4624: {
4625: zend_bool new_setting;
4626:
4627: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &new_setting) == FAILURE) {
4628: return;
4629: }
4630:
4631: PG(magic_quotes_runtime) = new_setting;
4632: RETURN_TRUE;
4633: }
4634: /* }}} */
4635:
4636: /* {{{ proto int get_magic_quotes_runtime(void)
4637: Get the current active configuration setting of magic_quotes_runtime */
4638: PHP_FUNCTION(get_magic_quotes_runtime)
4639: {
4640: RETURN_LONG(PG(magic_quotes_runtime));
4641: }
4642: /* }}} */
4643:
4644: /* {{{ proto int get_magic_quotes_gpc(void)
4645: Get the current active configuration setting of magic_quotes_gpc */
4646: PHP_FUNCTION(get_magic_quotes_gpc)
4647: {
4648: RETURN_LONG(PG(magic_quotes_gpc));
4649: }
4650: /* }}} */
4651:
4652: /*
4653: 1st arg = error message
4654: 2nd arg = error option
4655: 3rd arg = optional parameters (email address or tcp address)
4656: 4th arg = used for additional headers if email
4657:
4658: error options:
4659: 0 = send to php_error_log (uses syslog or file depending on ini setting)
4660: 1 = send via email to 3rd parameter 4th option = additional headers
4661: 2 = send via tcp/ip to 3rd parameter (name or ip:port)
4662: 3 = save to file in 3rd parameter
4663: 4 = send to SAPI logger directly
4664: */
4665:
4666: /* {{{ proto bool error_log(string message [, int message_type [, string destination [, string extra_headers]]])
4667: Send an error message somewhere */
4668: PHP_FUNCTION(error_log)
4669: {
4670: char *message, *opt = NULL, *headers = NULL;
4671: int message_len, opt_len = 0, headers_len = 0;
4672: int opt_err = 0, argc = ZEND_NUM_ARGS();
4673: long erropt = 0;
4674:
4675: if (zend_parse_parameters(argc TSRMLS_CC, "s|lss", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
4676: return;
4677: }
4678:
4679: if (argc > 1) {
4680: opt_err = erropt;
4681: }
4682:
4683: if (opt_err == 3 && opt) {
4684: if (strlen(opt) != opt_len) {
4685: RETURN_FALSE;
4686: }
4687: }
4688:
4689: if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) {
4690: RETURN_FALSE;
4691: }
4692:
4693: RETURN_TRUE;
4694: }
4695: /* }}} */
4696:
4697: /* For BC (not binary-safe!) */
4698: PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) /* {{{ */
4699: {
4700: return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC);
4701: }
4702: /* }}} */
4703:
4704: PHPAPI int _php_error_log_ex(int opt_err, char *message, int message_len, char *opt, char *headers TSRMLS_DC) /* {{{ */
4705: {
4706: php_stream *stream = NULL;
4707:
4708: switch (opt_err)
4709: {
4710: case 1: /*send an email */
4711: if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
4712: return FAILURE;
4713: }
4714: break;
4715:
4716: case 2: /*send to an address */
4717: php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!");
4718: return FAILURE;
4719: break;
4720:
4721: case 3: /*save to a file */
4722: stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
4723: if (!stream) {
4724: return FAILURE;
4725: }
4726: php_stream_write(stream, message, message_len);
4727: php_stream_close(stream);
4728: break;
4729:
4730: case 4: /* send to SAPI */
4731: if (sapi_module.log_message) {
4732: sapi_module.log_message(message);
4733: } else {
4734: return FAILURE;
4735: }
4736: break;
4737:
4738: default:
4739: php_log_err(message TSRMLS_CC);
4740: break;
4741: }
4742: return SUCCESS;
4743: }
4744: /* }}} */
4745:
4746: /* {{{ proto array error_get_last()
4747: Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
4748: PHP_FUNCTION(error_get_last)
4749: {
4750: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
4751: return;
4752: }
4753:
4754: if (PG(last_error_message)) {
4755: array_init(return_value);
4756: add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
4757: add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
4758: add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
4759: add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
4760: }
4761: }
4762: /* }}} */
4763:
4764: /* {{{ proto mixed call_user_func(mixed function_name [, mixed parmeter] [, mixed ...])
4765: Call a user function which is the first parameter */
4766: PHP_FUNCTION(call_user_func)
4767: {
4768: zval *retval_ptr = NULL;
4769: zend_fcall_info fci;
4770: zend_fcall_info_cache fci_cache;
4771:
4772: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
4773: return;
4774: }
4775:
4776: fci.retval_ptr_ptr = &retval_ptr;
4777:
4778: if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
4779: COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
4780: }
4781:
4782: if (fci.params) {
4783: efree(fci.params);
4784: }
4785: }
4786: /* }}} */
4787:
4788: /* {{{ proto mixed call_user_func_array(string function_name, array parameters)
4789: Call a user function which is the first parameter with the arguments contained in array */
4790: PHP_FUNCTION(call_user_func_array)
4791: {
4792: zval *params, *retval_ptr = NULL;
4793: zend_fcall_info fci;
4794: zend_fcall_info_cache fci_cache;
4795:
4796: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, ¶ms) == FAILURE) {
4797: return;
4798: }
4799:
4800: zend_fcall_info_args(&fci, params TSRMLS_CC);
4801: fci.retval_ptr_ptr = &retval_ptr;
4802:
4803: if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
4804: COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
4805: }
4806:
4807: zend_fcall_info_args_clear(&fci, 1);
4808: }
4809: /* }}} */
4810:
4811: /* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
4812: Call a user method on a specific object or class */
4813: PHP_FUNCTION(call_user_method)
4814: {
4815: zval ***params = NULL;
4816: int n_params = 0;
4817: zval *retval_ptr;
4818: zval *callback, *object;
4819:
4820: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z*", &callback, &object, ¶ms, &n_params) == FAILURE) {
4821: return;
4822: }
4823:
4824: if (Z_TYPE_P(object) != IS_OBJECT &&
4825: Z_TYPE_P(object) != IS_STRING
4826: ) {
4827: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
4828: if (params) {
4829: efree(params);
4830: }
4831: RETURN_FALSE;
4832: }
4833:
4834: convert_to_string(callback);
4835:
4836: if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
4837: if (retval_ptr) {
4838: COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
4839: }
4840: } else {
4841: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
4842: }
4843: if (n_params) {
4844: efree(params);
4845: }
4846: }
4847: /* }}} */
4848:
4849: /* {{{ proto mixed call_user_method_array(string method_name, mixed object, array params)
4850: Call a user method on a specific object or class using a parameter array */
4851: PHP_FUNCTION(call_user_method_array)
4852: {
4853: zval *params, ***method_args = NULL, *retval_ptr;
4854: zval *callback, *object;
4855: HashTable *params_ar;
4856: int num_elems, element = 0;
4857:
4858: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, ¶ms) == FAILURE) {
4859: return;
4860: }
4861:
4862: if (Z_TYPE_P(object) != IS_OBJECT &&
4863: Z_TYPE_P(object) != IS_STRING
4864: ) {
4865: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
4866: RETURN_FALSE;
4867: }
4868:
4869: convert_to_string(callback);
4870:
4871: params_ar = HASH_OF(params);
4872: num_elems = zend_hash_num_elements(params_ar);
4873: method_args = (zval ***) safe_emalloc(sizeof(zval **), num_elems, 0);
4874:
4875: for (zend_hash_internal_pointer_reset(params_ar);
4876: zend_hash_get_current_data(params_ar, (void **) &(method_args[element])) == SUCCESS;
4877: zend_hash_move_forward(params_ar)
4878: ) {
4879: element++;
4880: }
4881:
4882: if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) {
4883: if (retval_ptr) {
4884: COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
4885: }
4886: } else {
4887: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
4888: }
4889:
4890: efree(method_args);
4891: }
4892: /* }}} */
4893:
4894: /* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U
4895: Call a user function which is the first parameter */
4896: PHP_FUNCTION(forward_static_call)
4897: {
4898: zval *retval_ptr = NULL;
4899: zend_fcall_info fci;
4900: zend_fcall_info_cache fci_cache;
4901:
4902: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
4903: return;
4904: }
4905:
4906: if (!EG(active_op_array)->scope) {
4907: zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active");
4908: }
4909:
4910: fci.retval_ptr_ptr = &retval_ptr;
4911:
4912: if (EG(called_scope) &&
4913: instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
4914: fci_cache.called_scope = EG(called_scope);
4915: }
4916:
4917: if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
4918: COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
4919: }
4920:
4921: if (fci.params) {
4922: efree(fci.params);
4923: }
4924: }
4925: /* }}} */
4926:
4927: /* {{{ proto mixed call_user_func_array(string function_name, array parameters) U
4928: Call a user function which is the first parameter with the arguments contained in array */
4929: PHP_FUNCTION(forward_static_call_array)
4930: {
4931: zval *params, *retval_ptr = NULL;
4932: zend_fcall_info fci;
4933: zend_fcall_info_cache fci_cache;
4934:
4935: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, ¶ms) == FAILURE) {
4936: return;
4937: }
4938:
4939: zend_fcall_info_args(&fci, params TSRMLS_CC);
4940: fci.retval_ptr_ptr = &retval_ptr;
4941:
4942: if (EG(called_scope) &&
4943: instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
4944: fci_cache.called_scope = EG(called_scope);
4945: }
4946:
4947: if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
4948: COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
4949: }
4950:
4951: zend_fcall_info_args_clear(&fci, 1);
4952: }
4953: /* }}} */
4954:
4955: void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
4956: {
4957: int i;
4958:
4959: for (i = 0; i < shutdown_function_entry->arg_count; i++) {
4960: zval_ptr_dtor(&shutdown_function_entry->arguments[i]);
4961: }
4962: efree(shutdown_function_entry->arguments);
4963: }
4964: /* }}} */
4965:
4966: void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* {{{ */
4967: {
4968: int i;
4969:
4970: for (i = 0; i < tick_function_entry->arg_count; i++) {
4971: zval_ptr_dtor(&tick_function_entry->arguments[i]);
4972: }
4973: efree(tick_function_entry->arguments);
4974: }
4975: /* }}} */
4976:
4977: static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_function_entry TSRMLS_DC) /* {{{ */
4978: {
4979: zval retval;
4980: char *function_name;
4981:
4982: if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) {
4983: php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", function_name);
4984: if (function_name) {
4985: efree(function_name);
4986: }
4987: return 0;
4988: }
4989: if (function_name) {
4990: efree(function_name);
4991: }
4992:
4993: if (call_user_function(EG(function_table), NULL,
4994: shutdown_function_entry->arguments[0],
4995: &retval,
4996: shutdown_function_entry->arg_count - 1,
4997: shutdown_function_entry->arguments + 1
4998: TSRMLS_CC ) == SUCCESS)
4999: {
5000: zval_dtor(&retval);
5001: }
5002: return 0;
5003: }
5004: /* }}} */
5005:
5006: static void user_tick_function_call(user_tick_function_entry *tick_fe TSRMLS_DC) /* {{{ */
5007: {
5008: zval retval;
5009: zval *function = tick_fe->arguments[0];
5010:
5011: /* Prevent reentrant calls to the same user ticks function */
5012: if (! tick_fe->calling) {
5013: tick_fe->calling = 1;
5014:
5015: if (call_user_function( EG(function_table), NULL,
5016: function,
5017: &retval,
5018: tick_fe->arg_count - 1,
5019: tick_fe->arguments + 1
5020: TSRMLS_CC) == SUCCESS) {
5021: zval_dtor(&retval);
5022:
5023: } else {
5024: zval **obj, **method;
5025:
5026: if (Z_TYPE_P(function) == IS_STRING) {
5027: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
5028: } else if ( Z_TYPE_P(function) == IS_ARRAY
5029: && zend_hash_index_find(Z_ARRVAL_P(function), 0, (void **) &obj) == SUCCESS
5030: && zend_hash_index_find(Z_ARRVAL_P(function), 1, (void **) &method) == SUCCESS
5031: && Z_TYPE_PP(obj) == IS_OBJECT
5032: && Z_TYPE_PP(method) == IS_STRING) {
5033: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s::%s() - function does not exist", Z_OBJCE_PP(obj)->name, Z_STRVAL_PP(method));
5034: } else {
5035: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call tick function");
5036: }
5037: }
5038:
5039: tick_fe->calling = 0;
5040: }
5041: }
5042: /* }}} */
5043:
5044: static void run_user_tick_functions(int tick_count) /* {{{ */
5045: {
5046: TSRMLS_FETCH();
5047:
5048: zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call TSRMLS_CC);
5049: }
5050: /* }}} */
5051:
5052: static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_tick_function_entry * tick_fe2) /* {{{ */
5053: {
5054: zval *func1 = tick_fe1->arguments[0];
5055: zval *func2 = tick_fe2->arguments[0];
5056: int ret;
5057: TSRMLS_FETCH();
5058:
5059: if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
5060: ret = (zend_binary_zval_strcmp(func1, func2) == 0);
5061: } else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
5062: zval result;
5063: zend_compare_arrays(&result, func1, func2 TSRMLS_CC);
5064: ret = (Z_LVAL(result) == 0);
5065: } else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
5066: zval result;
5067: zend_compare_objects(&result, func1, func2 TSRMLS_CC);
5068: ret = (Z_LVAL(result) == 0);
5069: } else {
5070: ret = 0;
5071: }
5072:
5073: if (ret && tick_fe1->calling) {
5074: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to delete tick function executed at the moment");
5075: return 0;
5076: }
5077: return ret;
5078: }
5079: /* }}} */
5080:
5081: void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
5082: {
5083: if (BG(user_shutdown_function_names)) {
5084: zend_try {
5085: zend_hash_apply(BG(user_shutdown_function_names), (apply_func_t) user_shutdown_function_call TSRMLS_CC);
5086: }
5087: zend_end_try();
5088: php_free_shutdown_functions(TSRMLS_C);
5089: }
5090: }
5091: /* }}} */
5092:
5093: void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
5094: {
5095: if (BG(user_shutdown_function_names))
5096: zend_try {
5097: zend_hash_destroy(BG(user_shutdown_function_names));
5098: FREE_HASHTABLE(BG(user_shutdown_function_names));
5099: BG(user_shutdown_function_names) = NULL;
5100: }
5101: zend_end_try();
5102: }
5103: /* }}} */
5104:
5105: /* {{{ proto void register_shutdown_function(string function_name) U
5106: Register a user-level function to be called on request termination */
5107: PHP_FUNCTION(register_shutdown_function)
5108: {
5109: php_shutdown_function_entry shutdown_function_entry;
5110: char *function_name = NULL;
5111: int i;
5112:
5113: shutdown_function_entry.arg_count = ZEND_NUM_ARGS();
5114:
5115: if (shutdown_function_entry.arg_count < 1) {
5116: WRONG_PARAM_COUNT;
5117: }
5118:
5119: shutdown_function_entry.arguments = (zval **) safe_emalloc(sizeof(zval *), shutdown_function_entry.arg_count, 0);
5120:
5121: if (zend_get_parameters_array(ht, shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) {
5122: efree(shutdown_function_entry.arguments);
5123: RETURN_FALSE;
5124: }
5125:
5126: /* Prevent entering of anything but valid callback (syntax check only!) */
5127: if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &function_name TSRMLS_CC)) {
5128: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", function_name);
5129: efree(shutdown_function_entry.arguments);
5130: RETVAL_FALSE;
5131: } else {
5132: if (!BG(user_shutdown_function_names)) {
5133: ALLOC_HASHTABLE(BG(user_shutdown_function_names));
5134: zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *)) user_shutdown_function_dtor, 0);
5135: }
5136:
5137: for (i = 0; i < shutdown_function_entry.arg_count; i++) {
5138: Z_ADDREF_P(shutdown_function_entry.arguments[i]);
5139: }
5140: zend_hash_next_index_insert(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL);
5141: }
5142: if (function_name) {
5143: efree(function_name);
5144: }
5145: }
5146: /* }}} */
5147:
5148: ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini) /* {{{ */
5149: {
5150: syntax_highlighter_ini->highlight_comment = INI_STR("highlight.comment");
5151: syntax_highlighter_ini->highlight_default = INI_STR("highlight.default");
5152: syntax_highlighter_ini->highlight_html = INI_STR("highlight.html");
5153: syntax_highlighter_ini->highlight_keyword = INI_STR("highlight.keyword");
5154: syntax_highlighter_ini->highlight_string = INI_STR("highlight.string");
5155: }
5156: /* }}} */
5157:
5158: /* {{{ proto bool highlight_file(string file_name [, bool return] )
5159: Syntax highlight a source file */
5160: PHP_FUNCTION(highlight_file)
5161: {
5162: char *filename;
5163: int filename_len;
5164: zend_syntax_highlighter_ini syntax_highlighter_ini;
5165: zend_bool i = 0;
5166:
5167: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) {
5168: RETURN_FALSE;
5169: }
5170:
5171: if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
5172: RETURN_FALSE;
5173: }
5174:
5175: if (php_check_open_basedir(filename TSRMLS_CC)) {
5176: RETURN_FALSE;
5177: }
5178:
5179: if (strlen(filename) != filename_len) {
5180: RETURN_FALSE;
5181: }
5182:
5183: if (i) {
5184: php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
5185: }
5186:
5187: php_get_highlight_struct(&syntax_highlighter_ini);
5188:
5189: if (highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC) == FAILURE) {
5190: if (i) {
5191: int res = php_ob_get_buffer(return_value TSRMLS_CC);
5192:
5193: /* flush the buffer only if there is something to flush */
5194: if (res == SUCCESS && Z_STRLEN_P(return_value) > 0) {
5195: php_end_ob_buffer (1, 0 TSRMLS_CC);
5196: zval_dtor(return_value);
5197: } else {
5198: php_end_ob_buffer (0, 0 TSRMLS_CC);
5199: if (res == SUCCESS) {
5200: zval_dtor(return_value);
5201: }
5202: }
5203: }
5204: RETURN_FALSE;
5205: }
5206:
5207: if (i) {
5208: php_ob_get_buffer (return_value TSRMLS_CC);
5209: php_end_ob_buffer (0, 0 TSRMLS_CC);
5210: } else {
5211: RETURN_TRUE;
5212: }
5213: }
5214: /* }}} */
5215:
5216: /* {{{ proto string php_strip_whitespace(string file_name)
5217: Return source with stripped comments and whitespace */
5218: PHP_FUNCTION(php_strip_whitespace)
5219: {
5220: char *filename;
5221: int filename_len;
5222: zend_lex_state original_lex_state;
5223: zend_file_handle file_handle = {0};
5224:
5225: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
5226: RETURN_FALSE;
5227: }
5228:
5229: if (strlen(filename) != filename_len) {
5230: RETURN_FALSE;
5231: }
5232:
5233: file_handle.type = ZEND_HANDLE_FILENAME;
5234: file_handle.filename = filename;
5235: file_handle.free_filename = 0;
5236: file_handle.opened_path = NULL;
5237: zend_save_lexical_state(&original_lex_state TSRMLS_CC);
5238: if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
5239: zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
5240: RETURN_EMPTY_STRING();
5241: }
5242:
5243: php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);
5244:
5245: zend_strip(TSRMLS_C);
5246:
5247: zend_destroy_file_handle(&file_handle TSRMLS_CC);
5248: zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
5249:
5250: php_ob_get_buffer(return_value TSRMLS_CC);
5251: php_end_ob_buffer(0, 0 TSRMLS_CC);
5252: }
5253: /* }}} */
5254:
5255: /* {{{ proto bool highlight_string(string string [, bool return] )
5256: Syntax highlight a string or optionally return it */
5257: PHP_FUNCTION(highlight_string)
5258: {
5259: zval **expr;
5260: zend_syntax_highlighter_ini syntax_highlighter_ini;
5261: char *hicompiled_string_description;
5262: zend_bool i = 0;
5263: int old_error_reporting = EG(error_reporting);
5264:
5265: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) {
5266: RETURN_FALSE;
5267: }
5268: convert_to_string_ex(expr);
5269:
5270: if (i) {
5271: php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
5272: }
5273:
5274: EG(error_reporting) = E_ERROR;
5275:
5276: php_get_highlight_struct(&syntax_highlighter_ini);
5277:
5278: hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);
5279:
5280: if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
5281: efree(hicompiled_string_description);
5282: EG(error_reporting) = old_error_reporting;
5283: if (i) {
5284: php_end_ob_buffer (1, 0 TSRMLS_CC);
5285: }
5286: RETURN_FALSE;
5287: }
5288: efree(hicompiled_string_description);
5289:
5290: EG(error_reporting) = old_error_reporting;
5291:
5292: if (i) {
5293: php_ob_get_buffer (return_value TSRMLS_CC);
5294: php_end_ob_buffer (0, 0 TSRMLS_CC);
5295: } else {
5296: RETURN_TRUE;
5297: }
5298: }
5299: /* }}} */
5300:
5301: /* {{{ proto string ini_get(string varname)
5302: Get a configuration option */
5303: PHP_FUNCTION(ini_get)
5304: {
5305: char *varname, *str;
5306: int varname_len;
5307:
5308: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
5309: return;
5310: }
5311:
5312: str = zend_ini_string(varname, varname_len + 1, 0);
5313:
5314: if (!str) {
5315: RETURN_FALSE;
5316: }
5317:
5318: RETURN_STRING(str, 1);
5319: }
5320: /* }}} */
5321:
5322: static int php_ini_get_option(zend_ini_entry *ini_entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
5323: {
5324: zval *ini_array = va_arg(args, zval *);
5325: int module_number = va_arg(args, int);
5326: int details = va_arg(args, int);
5327: zval *option;
5328:
5329: if (module_number != 0 && ini_entry->module_number != module_number) {
5330: return 0;
5331: }
5332:
5333: if (hash_key->nKeyLength == 0 ||
5334: hash_key->arKey[0] != 0
5335: ) {
5336: if (details) {
5337: MAKE_STD_ZVAL(option);
5338: array_init(option);
5339:
5340: if (ini_entry->orig_value) {
5341: add_assoc_stringl(option, "global_value", ini_entry->orig_value, ini_entry->orig_value_length, 1);
5342: } else if (ini_entry->value) {
5343: add_assoc_stringl(option, "global_value", ini_entry->value, ini_entry->value_length, 1);
5344: } else {
5345: add_assoc_null(option, "global_value");
5346: }
5347:
5348: if (ini_entry->value) {
5349: add_assoc_stringl(option, "local_value", ini_entry->value, ini_entry->value_length, 1);
5350: } else {
5351: add_assoc_null(option, "local_value");
5352: }
5353:
5354: add_assoc_long(option, "access", ini_entry->modifiable);
5355:
5356: add_assoc_zval_ex(ini_array, ini_entry->name, ini_entry->name_length, option);
5357: } else {
5358: if (ini_entry->value) {
5359: add_assoc_stringl(ini_array, ini_entry->name, ini_entry->value, ini_entry->value_length, 1);
5360: } else {
5361: add_assoc_null(ini_array, ini_entry->name);
5362: }
5363: }
5364: }
5365: return 0;
5366: }
5367: /* }}} */
5368:
5369: /* {{{ proto array ini_get_all([string extension[, bool details = true]])
5370: Get all configuration options */
5371: PHP_FUNCTION(ini_get_all)
5372: {
5373: char *extname = NULL;
5374: int extname_len = 0, extnumber = 0;
5375: zend_module_entry *module;
5376: zend_bool details = 1;
5377:
5378: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &extname, &extname_len, &details) == FAILURE) {
5379: return;
5380: }
5381:
5382: zend_ini_sort_entries(TSRMLS_C);
5383:
5384: if (extname) {
5385: if (zend_hash_find(&module_registry, extname, extname_len+1, (void **) &module) == FAILURE) {
5386: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname);
5387: RETURN_FALSE;
5388: }
5389: extnumber = module->module_number;
5390: }
5391:
5392: array_init(return_value);
5393: zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) php_ini_get_option, 2, return_value, extnumber, details);
5394: }
5395: /* }}} */
5396:
5397: static int php_ini_check_path(char *option_name, int option_len, char *new_option_name, int new_option_len) /* {{{ */
5398: {
5399: if (option_len != (new_option_len - 1)) {
5400: return 0;
5401: }
5402:
5403: return !strncmp(option_name, new_option_name, option_len);
5404: }
5405: /* }}} */
5406:
5407: /* {{{ proto string ini_set(string varname, string newvalue)
5408: Set a configuration option, returns false on error and the old value of the configuration option on success */
5409: PHP_FUNCTION(ini_set)
5410: {
5411: char *varname, *new_value;
5412: int varname_len, new_value_len;
5413: char *old_value;
5414:
5415: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &varname, &varname_len, &new_value, &new_value_len) == FAILURE) {
5416: return;
5417: }
5418:
5419: old_value = zend_ini_string(varname, varname_len + 1, 0);
5420:
5421: /* copy to return here, because alter might free it! */
5422: if (old_value) {
5423: RETVAL_STRING(old_value, 1);
5424: } else {
5425: RETVAL_FALSE;
5426: }
5427:
5428: #define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini))
5429: /* safe_mode & basedir check */
5430: if (PG(safe_mode) || PG(open_basedir)) {
5431: if (_CHECK_PATH(varname, varname_len, "error_log") ||
5432: _CHECK_PATH(varname, varname_len, "java.class.path") ||
5433: _CHECK_PATH(varname, varname_len, "java.home") ||
5434: _CHECK_PATH(varname, varname_len, "mail.log") ||
5435: _CHECK_PATH(varname, varname_len, "java.library.path") ||
5436: _CHECK_PATH(varname, varname_len, "vpopmail.directory")) {
5437: if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
5438: zval_dtor(return_value);
5439: RETURN_FALSE;
5440: }
5441: if (php_check_open_basedir(new_value TSRMLS_CC)) {
5442: zval_dtor(return_value);
5443: RETURN_FALSE;
5444: }
5445: }
5446: }
5447:
5448: /* checks that ensure the user does not overwrite certain ini settings when safe_mode is enabled */
5449: if (PG(safe_mode)) {
5450: if (!strncmp("max_execution_time", varname, sizeof("max_execution_time")) ||
5451: !strncmp("memory_limit", varname, sizeof("memory_limit")) ||
5452: !strncmp("child_terminate", varname, sizeof("child_terminate"))
5453: ) {
5454: zval_dtor(return_value);
5455: RETURN_FALSE;
5456: }
5457: }
5458:
5459: if (zend_alter_ini_entry_ex(varname, varname_len + 1, new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
5460: zval_dtor(return_value);
5461: RETURN_FALSE;
5462: }
5463: }
5464: /* }}} */
5465:
5466: /* {{{ proto void ini_restore(string varname)
5467: Restore the value of a configuration option specified by varname */
5468: PHP_FUNCTION(ini_restore)
5469: {
5470: char *varname;
5471: int varname_len;
5472:
5473: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
5474: return;
5475: }
5476:
5477: zend_restore_ini_entry(varname, varname_len+1, PHP_INI_STAGE_RUNTIME);
5478: }
5479: /* }}} */
5480:
5481: /* {{{ proto string set_include_path(string new_include_path)
5482: Sets the include_path configuration option */
5483: PHP_FUNCTION(set_include_path)
5484: {
5485: char *new_value;
5486: int new_value_len;
5487: char *old_value;
5488:
5489: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_value, &new_value_len) == FAILURE) {
5490: return;
5491: }
5492:
5493: /* No nulls allowed in paths */
5494: if (strlen(new_value) != new_value_len) {
5495: RETURN_FALSE;
5496: }
5497:
5498: old_value = zend_ini_string("include_path", sizeof("include_path"), 0);
5499: /* copy to return here, because alter might free it! */
5500: if (old_value) {
5501: RETVAL_STRING(old_value, 1);
5502: } else {
5503: RETVAL_FALSE;
5504: }
5505:
5506: if (zend_alter_ini_entry_ex("include_path", sizeof("include_path"), new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
5507: zval_dtor(return_value);
5508: RETURN_FALSE;
5509: }
5510: }
5511: /* }}} */
5512:
5513: /* {{{ proto string get_include_path()
5514: Get the current include_path configuration option */
5515: PHP_FUNCTION(get_include_path)
5516: {
5517: char *str;
5518:
5519: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
5520: return;
5521: }
5522:
5523: str = zend_ini_string("include_path", sizeof("include_path"), 0);
5524:
5525: if (str == NULL) {
5526: RETURN_FALSE;
5527: }
5528:
5529: RETURN_STRING(str, 1);
5530: }
5531: /* }}} */
5532:
5533: /* {{{ proto void restore_include_path()
5534: Restore the value of the include_path configuration option */
5535: PHP_FUNCTION(restore_include_path)
5536: {
5537: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
5538: return;
5539: }
5540: zend_restore_ini_entry("include_path", sizeof("include_path"), PHP_INI_STAGE_RUNTIME);
5541: }
5542: /* }}} */
5543:
5544: /* {{{ proto mixed print_r(mixed var [, bool return])
5545: Prints out or returns information about the specified variable */
5546: PHP_FUNCTION(print_r)
5547: {
5548: zval *var;
5549: zend_bool do_return = 0;
5550:
5551: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &do_return) == FAILURE) {
5552: RETURN_FALSE;
5553: }
5554:
5555: if (do_return) {
5556: php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
5557: }
5558:
5559: zend_print_zval_r(var, 0 TSRMLS_CC);
5560:
5561: if (do_return) {
5562: php_ob_get_buffer (return_value TSRMLS_CC);
5563: php_end_ob_buffer (0, 0 TSRMLS_CC);
5564: } else {
5565: RETURN_TRUE;
5566: }
5567: }
5568: /* }}} */
5569:
5570: /* {{{ proto int connection_aborted(void)
5571: Returns true if client disconnected */
5572: PHP_FUNCTION(connection_aborted)
5573: {
5574: RETURN_LONG(PG(connection_status) & PHP_CONNECTION_ABORTED);
5575: }
5576: /* }}} */
5577:
5578: /* {{{ proto int connection_status(void)
5579: Returns the connection status bitfield */
5580: PHP_FUNCTION(connection_status)
5581: {
5582: RETURN_LONG(PG(connection_status));
5583: }
5584: /* }}} */
5585:
5586: /* {{{ proto int ignore_user_abort([string value])
5587: Set whether we want to ignore a user abort event or not */
5588: PHP_FUNCTION(ignore_user_abort)
5589: {
5590: char *arg = NULL;
5591: int arg_len = 0;
5592: int old_setting;
5593:
5594: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
5595: return;
5596: }
5597:
5598: old_setting = PG(ignore_user_abort);
5599:
5600: if (arg) {
5601: zend_alter_ini_entry_ex("ignore_user_abort", sizeof("ignore_user_abort"), arg, arg_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
5602: }
5603:
5604: RETURN_LONG(old_setting);
5605: }
5606: /* }}} */
5607:
5608: #if HAVE_GETSERVBYNAME
5609: /* {{{ proto int getservbyname(string service, string protocol)
5610: Returns port associated with service. Protocol must be "tcp" or "udp" */
5611: PHP_FUNCTION(getservbyname)
5612: {
5613: char *name, *proto;
5614: int name_len, proto_len;
5615: struct servent *serv;
5616:
5617: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
5618: return;
5619: }
5620:
5621:
5622: /* empty string behaves like NULL on windows implementation of
5623: getservbyname. Let be portable instead. */
5624: #ifdef PHP_WIN32
5625: if (proto_len == 0) {
5626: RETURN_FALSE;
5627: }
5628: #endif
5629:
5630: serv = getservbyname(name, proto);
5631:
5632: if (serv == NULL) {
5633: RETURN_FALSE;
5634: }
5635:
5636: RETURN_LONG(ntohs(serv->s_port));
5637: }
5638: /* }}} */
5639: #endif
5640:
5641: #if HAVE_GETSERVBYPORT
5642: /* {{{ proto string getservbyport(int port, string protocol)
5643: Returns service name associated with port. Protocol must be "tcp" or "udp" */
5644: PHP_FUNCTION(getservbyport)
5645: {
5646: char *proto;
5647: int proto_len;
5648: long port;
5649: struct servent *serv;
5650:
5651: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &port, &proto, &proto_len) == FAILURE) {
5652: return;
5653: }
5654:
5655: serv = getservbyport(htons((unsigned short) port), proto);
5656:
5657: if (serv == NULL) {
5658: RETURN_FALSE;
5659: }
5660:
5661: RETURN_STRING(serv->s_name, 1);
5662: }
5663: /* }}} */
5664: #endif
5665:
5666: #if HAVE_GETPROTOBYNAME
5667: /* {{{ proto int getprotobyname(string name)
5668: Returns protocol number associated with name as per /etc/protocols */
5669: PHP_FUNCTION(getprotobyname)
5670: {
5671: char *name;
5672: int name_len;
5673: struct protoent *ent;
5674:
5675: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
5676: return;
5677: }
5678:
5679: ent = getprotobyname(name);
5680:
5681: if (ent == NULL) {
5682: RETURN_FALSE;
5683: }
5684:
5685: RETURN_LONG(ent->p_proto);
5686: }
5687: /* }}} */
5688: #endif
5689:
5690: #if HAVE_GETPROTOBYNUMBER
5691: /* {{{ proto string getprotobynumber(int proto)
5692: Returns protocol name associated with protocol number proto */
5693: PHP_FUNCTION(getprotobynumber)
5694: {
5695: long proto;
5696: struct protoent *ent;
5697:
5698: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &proto) == FAILURE) {
5699: return;
5700: }
5701:
5702: ent = getprotobynumber(proto);
5703:
5704: if (ent == NULL) {
5705: RETURN_FALSE;
5706: }
5707:
5708: RETURN_STRING(ent->p_name, 1);
5709: }
5710: /* }}} */
5711: #endif
5712:
5713: /* {{{ proto bool register_tick_function(string function_name [, mixed arg [, mixed ... ]])
5714: Registers a tick callback function */
5715: PHP_FUNCTION(register_tick_function)
5716: {
5717: user_tick_function_entry tick_fe;
5718: int i;
5719: char *function_name = NULL;
5720:
5721: tick_fe.calling = 0;
5722: tick_fe.arg_count = ZEND_NUM_ARGS();
5723:
5724: if (tick_fe.arg_count < 1) {
5725: WRONG_PARAM_COUNT;
5726: }
5727:
5728: tick_fe.arguments = (zval **) safe_emalloc(sizeof(zval *), tick_fe.arg_count, 0);
5729:
5730: if (zend_get_parameters_array(ht, tick_fe.arg_count, tick_fe.arguments) == FAILURE) {
5731: efree(tick_fe.arguments);
5732: RETURN_FALSE;
5733: }
5734:
5735: if (!zend_is_callable(tick_fe.arguments[0], 0, &function_name TSRMLS_CC)) {
5736: efree(tick_fe.arguments);
5737: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid tick callback '%s' passed", function_name);
5738: efree(function_name);
5739: RETURN_FALSE;
5740: } else if (function_name) {
5741: efree(function_name);
5742: }
5743:
5744: if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE_P(tick_fe.arguments[0]) != IS_OBJECT) {
5745: convert_to_string_ex(&tick_fe.arguments[0]);
5746: }
5747:
5748: if (!BG(user_tick_functions)) {
5749: BG(user_tick_functions) = (zend_llist *) emalloc(sizeof(zend_llist));
5750: zend_llist_init(BG(user_tick_functions),
5751: sizeof(user_tick_function_entry),
5752: (llist_dtor_func_t) user_tick_function_dtor, 0);
5753: php_add_tick_function(run_user_tick_functions);
5754: }
5755:
5756: for (i = 0; i < tick_fe.arg_count; i++) {
5757: Z_ADDREF_P(tick_fe.arguments[i]);
5758: }
5759:
5760: zend_llist_add_element(BG(user_tick_functions), &tick_fe);
5761:
5762: RETURN_TRUE;
5763: }
5764: /* }}} */
5765:
5766: /* {{{ proto void unregister_tick_function(string function_name)
5767: Unregisters a tick callback function */
5768: PHP_FUNCTION(unregister_tick_function)
5769: {
5770: zval *function;
5771: user_tick_function_entry tick_fe;
5772:
5773: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) {
5774: return;
5775: }
5776:
5777: if (!BG(user_tick_functions)) {
5778: return;
5779: }
5780:
5781: if (Z_TYPE_P(function) != IS_ARRAY) {
5782: convert_to_string(function);
5783: }
5784:
5785: tick_fe.arguments = (zval **) emalloc(sizeof(zval *));
5786: tick_fe.arguments[0] = function;
5787: tick_fe.arg_count = 1;
5788: zend_llist_del_element(BG(user_tick_functions), &tick_fe, (int (*)(void *, void *)) user_tick_function_compare);
5789: efree(tick_fe.arguments);
5790: }
5791: /* }}} */
5792:
5793: /* {{{ proto bool is_uploaded_file(string path)
5794: Check if file was created by rfc1867 upload */
5795: PHP_FUNCTION(is_uploaded_file)
5796: {
5797: char *path;
5798: int path_len;
5799:
5800: if (!SG(rfc1867_uploaded_files)) {
5801: RETURN_FALSE;
5802: }
5803:
5804: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
5805: return;
5806: }
5807:
5808: if (strlen(path) != path_len) {
5809: RETURN_FALSE;
5810: }
5811:
5812: if (zend_hash_exists(SG(rfc1867_uploaded_files), path, path_len + 1)) {
5813: RETURN_TRUE;
5814: } else {
5815: RETURN_FALSE;
5816: }
5817: }
5818: /* }}} */
5819:
5820: /* {{{ proto bool move_uploaded_file(string path, string new_path)
5821: Move a file if and only if it was created by an upload */
5822: PHP_FUNCTION(move_uploaded_file)
5823: {
5824: char *path, *new_path;
5825: int path_len, new_path_len;
5826: zend_bool successful = 0;
5827:
5828: #ifndef PHP_WIN32
5829: int oldmask; int ret;
5830: #endif
5831:
5832: if (!SG(rfc1867_uploaded_files)) {
5833: RETURN_FALSE;
5834: }
5835:
5836: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
5837: return;
5838: }
5839:
5840: if (!zend_hash_exists(SG(rfc1867_uploaded_files), path, path_len + 1)) {
5841: RETURN_FALSE;
5842: }
5843:
5844: if (PG(safe_mode) && (!php_checkuid(new_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
5845: RETURN_FALSE;
5846: }
5847:
5848: if (php_check_open_basedir(new_path TSRMLS_CC)) {
5849: RETURN_FALSE;
5850: }
5851:
5852: if (strlen(path) != path_len) {
5853: RETURN_FALSE;
5854: }
5855:
5856: if (strlen(new_path) != new_path_len) {
5857: RETURN_FALSE;
5858: }
5859:
5860: if (VCWD_RENAME(path, new_path) == 0) {
5861: successful = 1;
5862: #ifndef PHP_WIN32
5863: oldmask = umask(077);
5864: umask(oldmask);
5865:
5866: ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);
5867:
5868: if (ret == -1) {
5869: php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
5870: }
5871: #endif
5872: } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
5873: VCWD_UNLINK(path);
5874: successful = 1;
5875: }
5876:
5877: if (successful) {
5878: zend_hash_del(SG(rfc1867_uploaded_files), path, path_len + 1);
5879: } else {
5880: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
5881: }
5882:
5883: RETURN_BOOL(successful);
5884: }
5885: /* }}} */
5886:
5887: /* {{{ php_simple_ini_parser_cb
5888: */
5889: static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
5890: {
5891: zval *element;
5892:
5893: switch (callback_type) {
5894:
5895: case ZEND_INI_PARSER_ENTRY:
5896: if (!arg2) {
5897: /* bare string - nothing to do */
5898: break;
5899: }
5900: ALLOC_ZVAL(element);
5901: MAKE_COPY_ZVAL(&arg2, element);
5902: zend_symtable_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &element, sizeof(zval *), NULL);
5903: break;
5904:
5905: case ZEND_INI_PARSER_POP_ENTRY:
5906: {
5907: zval *hash, **find_hash;
5908:
5909: if (!arg2) {
5910: /* bare string - nothing to do */
5911: break;
5912: }
5913:
5914: if (!(Z_STRLEN_P(arg1) > 1 && Z_STRVAL_P(arg1)[0] == '0') && is_numeric_string(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), NULL, NULL, 0) == IS_LONG) {
5915: ulong key = (ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
5916: if (zend_hash_index_find(Z_ARRVAL_P(arr), key, (void **) &find_hash) == FAILURE) {
5917: ALLOC_ZVAL(hash);
5918: INIT_PZVAL(hash);
5919: array_init(hash);
5920:
5921: zend_hash_index_update(Z_ARRVAL_P(arr), key, &hash, sizeof(zval *), NULL);
5922: } else {
5923: hash = *find_hash;
5924: }
5925: } else {
5926: if (zend_hash_find(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, (void **) &find_hash) == FAILURE) {
5927: ALLOC_ZVAL(hash);
5928: INIT_PZVAL(hash);
5929: array_init(hash);
5930:
5931: zend_hash_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &hash, sizeof(zval *), NULL);
5932: } else {
5933: hash = *find_hash;
5934: }
5935: }
5936:
5937: if (Z_TYPE_P(hash) != IS_ARRAY) {
5938: zval_dtor(hash);
5939: INIT_PZVAL(hash);
5940: array_init(hash);
5941: }
5942:
5943: ALLOC_ZVAL(element);
5944: MAKE_COPY_ZVAL(&arg2, element);
5945:
5946: if (arg3 && Z_STRLEN_P(arg3) > 0) {
5947: add_assoc_zval_ex(hash, Z_STRVAL_P(arg3), Z_STRLEN_P(arg3) + 1, element);
5948: } else {
5949: add_next_index_zval(hash, element);
5950: }
5951: }
5952: break;
5953:
5954: case ZEND_INI_PARSER_SECTION:
5955: break;
5956: }
5957: }
5958: /* }}} */
5959:
5960: /* {{{ php_ini_parser_cb_with_sections
5961: */
5962: static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr TSRMLS_DC)
5963: {
5964: if (callback_type == ZEND_INI_PARSER_SECTION) {
5965: MAKE_STD_ZVAL(BG(active_ini_file_section));
5966: array_init(BG(active_ini_file_section));
5967: zend_symtable_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &BG(active_ini_file_section), sizeof(zval *), NULL);
5968: } else if (arg2) {
5969: zval *active_arr;
5970:
5971: if (BG(active_ini_file_section)) {
5972: active_arr = BG(active_ini_file_section);
5973: } else {
5974: active_arr = arr;
5975: }
5976:
5977: php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr TSRMLS_CC);
5978: }
5979: }
5980: /* }}} */
5981:
5982: /* {{{ proto array parse_ini_file(string filename [, bool process_sections [, int scanner_mode]])
5983: Parse configuration file */
5984: PHP_FUNCTION(parse_ini_file)
5985: {
5986: char *filename = NULL;
5987: int filename_len = 0;
5988: zend_bool process_sections = 0;
5989: long scanner_mode = ZEND_INI_SCANNER_NORMAL;
5990: zend_file_handle fh;
5991: zend_ini_parser_cb_t ini_parser_cb;
5992:
5993: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
5994: RETURN_FALSE;
5995: }
5996:
5997: if (filename_len == 0) {
5998: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty!");
5999: RETURN_FALSE;
6000: }
6001:
6002: if (strlen(filename) != filename_len) {
6003: RETURN_FALSE;
6004: }
6005:
6006: /* Set callback function */
6007: if (process_sections) {
6008: BG(active_ini_file_section) = NULL;
6009: ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
6010: } else {
6011: ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
6012: }
6013:
6014: /* Setup filehandle */
6015: memset(&fh, 0, sizeof(fh));
6016: fh.filename = filename;
6017: fh.type = ZEND_HANDLE_FILENAME;
6018:
6019: array_init(return_value);
6020: if (zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
6021: zend_hash_destroy(Z_ARRVAL_P(return_value));
6022: efree(Z_ARRVAL_P(return_value));
6023: RETURN_FALSE;
6024: }
6025: }
6026: /* }}} */
6027:
6028: /* {{{ proto array parse_ini_string(string ini_string [, bool process_sections [, int scanner_mode]])
6029: Parse configuration string */
6030: PHP_FUNCTION(parse_ini_string)
6031: {
6032: char *string = NULL, *str = NULL;
6033: int str_len = 0;
6034: zend_bool process_sections = 0;
6035: long scanner_mode = ZEND_INI_SCANNER_NORMAL;
6036: zend_ini_parser_cb_t ini_parser_cb;
6037:
6038: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
6039: RETURN_FALSE;
6040: }
6041:
6042: if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
6043: RETVAL_FALSE;
6044: }
6045:
6046: /* Set callback function */
6047: if (process_sections) {
6048: BG(active_ini_file_section) = NULL;
6049: ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
6050: } else {
6051: ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
6052: }
6053:
6054: /* Setup string */
6055: string = (char *) emalloc(str_len + ZEND_MMAP_AHEAD);
6056: memcpy(string, str, str_len);
6057: memset(string + str_len, 0, ZEND_MMAP_AHEAD);
6058:
6059: array_init(return_value);
6060: if (zend_parse_ini_string(string, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
6061: zend_hash_destroy(Z_ARRVAL_P(return_value));
6062: efree(Z_ARRVAL_P(return_value));
6063: RETVAL_FALSE;
6064: }
6065: efree(string);
6066: }
6067: /* }}} */
6068:
6069: #if ZEND_DEBUG
6070: /* This function returns an array of ALL valid ini options with values and
6071: * is not the same as ini_get_all() which returns only registered ini options. Only useful for devs to debug php.ini scanner/parser! */
6072: PHP_FUNCTION(config_get_hash) /* {{{ */
6073: {
6074: HashTable *hash = php_ini_get_configuration_hash();
6075:
6076: array_init(return_value);
6077: zend_hash_apply_with_arguments(hash TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
6078: }
6079: /* }}} */
6080: #endif
6081:
6082: static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
6083: {
6084: zval *prefix, new_key;
6085: int prefix_len;
6086: zval **var = (zval **) pDest;
6087:
6088: if (num_args != 1) {
6089: return 0;
6090: }
6091:
6092: prefix = va_arg(args, zval *);
6093: prefix_len = Z_STRLEN_P(prefix);
6094:
6095: if (!prefix_len && !hash_key->nKeyLength) {
6096: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric key detected - possible security hazard");
6097: return 0;
6098: }
6099:
6100: if (hash_key->nKeyLength) {
6101: php_prefix_varname(&new_key, prefix, hash_key->arKey, hash_key->nKeyLength - 1, 0 TSRMLS_CC);
6102: } else {
6103: zval num;
6104:
6105: ZVAL_LONG(&num, hash_key->h);
6106: convert_to_string(&num);
6107: php_prefix_varname(&new_key, prefix, Z_STRVAL(num), Z_STRLEN(num), 0 TSRMLS_CC);
6108: zval_dtor(&num);
6109: }
6110:
6111: if (php_varname_check(Z_STRVAL(new_key), Z_STRLEN(new_key), 0 TSRMLS_CC) == FAILURE) {
6112: zval_dtor(&new_key);
6113: return 0;
6114: }
6115:
6116: zend_delete_global_variable(Z_STRVAL(new_key), Z_STRLEN(new_key) TSRMLS_CC);
6117: ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), Z_STRVAL(new_key), Z_STRLEN(new_key) + 1, *var, Z_REFCOUNT_PP(var) + 1, 0);
6118:
6119: zval_dtor(&new_key);
6120: return 0;
6121: }
6122: /* }}} */
6123:
6124: /* {{{ proto bool import_request_variables(string types [, string prefix])
6125: Import GET/POST/Cookie variables into the global scope */
6126: PHP_FUNCTION(import_request_variables)
6127: {
6128: char *types;
6129: int types_len;
6130: zval *prefix = NULL;
6131: char *p;
6132: zend_bool ok = 0;
6133:
6134: if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &types, &types_len, &prefix) == FAILURE) {
6135: return;
6136: }
6137:
6138: if (ZEND_NUM_ARGS() > 1) {
6139: convert_to_string(prefix);
6140:
6141: if (Z_STRLEN_P(prefix) == 0) {
6142: php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard");
6143: }
6144: } else {
6145: MAKE_STD_ZVAL(prefix);
6146: ZVAL_EMPTY_STRING(prefix);
6147: }
6148:
6149: for (p = types; p && *p; p++) {
6150: switch (*p) {
6151:
6152: case 'g':
6153: case 'G':
6154: zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
6155: ok = 1;
6156: break;
6157:
6158: case 'p':
6159: case 'P':
6160: zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
6161: zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_FILES]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
6162: ok = 1;
6163: break;
6164:
6165: case 'c':
6166: case 'C':
6167: zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
6168: ok = 1;
6169: break;
6170: }
6171: }
6172:
6173: if (ZEND_NUM_ARGS() < 2) {
6174: zval_ptr_dtor(&prefix);
6175: }
6176: RETURN_BOOL(ok);
6177: }
6178: /* }}} */
6179:
6180: #ifdef HAVE_GETLOADAVG
6181: /* {{{ proto array sys_getloadavg()
6182: */
6183: PHP_FUNCTION(sys_getloadavg)
6184: {
6185: double load[3];
6186:
6187: if (getloadavg(load, 3) == -1) {
6188: RETURN_FALSE;
6189: } else {
6190: array_init(return_value);
6191: add_index_double(return_value, 0, load[0]);
6192: add_index_double(return_value, 1, load[1]);
6193: add_index_double(return_value, 2, load[2]);
6194: }
6195: }
6196: /* }}} */
6197: #endif
6198:
6199: /*
6200: * Local variables:
6201: * tab-width: 4
6202: * c-basic-offset: 4
6203: * End:
6204: * vim600: fdm=marker
6205: * vim: noet sw=4 ts=4
6206: */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>