2000-12-18 19:23:50 +00:00
|
|
|
/*
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2014-09-19 16:33:14 +00:00
|
|
|
| PHP Version 7 |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2018-01-02 04:57:58 +00:00
|
|
|
| Copyright (c) 1997-2018 The PHP Group |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
1999-07-16 13:13:16 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 12:51:34 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
1999-07-16 13:13:16 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2018-11-01 16:30:28 +00:00
|
|
|
| Authors: Andi Gutmans <andi@php.net> |
|
|
|
|
| Zeev Suraski <zeev@php.net> |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "php.h"
|
2002-03-15 21:03:08 +00:00
|
|
|
#include "php_streams.h"
|
2000-06-05 23:24:42 +00:00
|
|
|
#include "php_main.h"
|
2000-10-13 09:13:01 +00:00
|
|
|
#include "php_globals.h"
|
2015-10-12 19:24:19 +00:00
|
|
|
#include "php_variables.h"
|
1999-04-17 00:37:12 +00:00
|
|
|
#include "php_ini.h"
|
1999-12-04 19:19:57 +00:00
|
|
|
#include "php_standard.h"
|
2001-09-05 19:47:55 +00:00
|
|
|
#include "php_math.h"
|
2003-09-06 14:52:10 +00:00
|
|
|
#include "php_http.h"
|
2001-08-06 13:36:08 +00:00
|
|
|
#include "php_incomplete_class.h"
|
2007-10-01 12:40:54 +00:00
|
|
|
#include "php_getopt.h"
|
2000-04-05 21:43:03 +00:00
|
|
|
#include "ext/standard/info.h"
|
2001-08-25 15:57:42 +00:00
|
|
|
#include "ext/session/php_session.h"
|
1999-04-17 00:37:12 +00:00
|
|
|
#include "zend_operators.h"
|
2009-08-05 23:20:17 +00:00
|
|
|
#include "ext/standard/php_dns.h"
|
2003-10-27 05:35:41 +00:00
|
|
|
#include "ext/standard/php_uuencode.h"
|
2016-07-05 10:54:07 +00:00
|
|
|
#include "ext/standard/php_mt_rand.h"
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2004-07-29 02:59:44 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
#include "win32/php_win32_globals.h"
|
2009-01-19 02:35:22 +00:00
|
|
|
#include "win32/time.h"
|
2017-12-15 12:23:34 +00:00
|
|
|
#include "win32/ioutil.h"
|
2004-07-29 02:59:44 +00:00
|
|
|
#endif
|
|
|
|
|
2003-11-24 01:17:27 +00:00
|
|
|
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
|
|
|
|
|
|
|
#include "zend.h"
|
2007-09-28 02:05:10 +00:00
|
|
|
#include "zend_ini_scanner.h"
|
2003-11-24 01:17:27 +00:00
|
|
|
#include "zend_language_scanner.h"
|
2004-12-30 15:18:24 +00:00
|
|
|
#include <zend_language_parser.h>
|
2003-11-24 01:17:27 +00:00
|
|
|
|
2016-03-20 01:32:44 +00:00
|
|
|
#include "zend_portability.h"
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <stdio.h>
|
2002-09-05 12:03:43 +00:00
|
|
|
|
2007-11-02 19:40:39 +00:00
|
|
|
#ifndef PHP_WIN32
|
2007-10-22 07:37:37 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#endif
|
|
|
|
|
2008-08-23 19:22:10 +00:00
|
|
|
#ifndef PHP_WIN32
|
|
|
|
# include <netdb.h>
|
|
|
|
#else
|
|
|
|
#include "win32/inet.h"
|
|
|
|
#endif
|
2004-09-25 13:19:45 +00:00
|
|
|
|
2001-01-21 17:29:15 +00:00
|
|
|
#if HAVE_ARPA_INET_H
|
2001-08-29 16:00:30 +00:00
|
|
|
# include <arpa/inet.h>
|
2001-01-21 17:29:15 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
#if HAVE_UNISTD_H
|
2001-08-29 16:00:30 +00:00
|
|
|
# include <unistd.h>
|
1999-04-17 00:37:12 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2018-09-15 23:14:08 +00:00
|
|
|
#include <string.h>
|
2001-08-29 16:00:30 +00:00
|
|
|
|
1999-10-08 02:10:57 +00:00
|
|
|
#if HAVE_LOCALE_H
|
2001-08-29 16:00:30 +00:00
|
|
|
# include <locale.h>
|
1999-10-08 02:10:57 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-05-18 23:38:46 +00:00
|
|
|
#if HAVE_SYS_MMAN_H
|
2001-08-29 16:00:30 +00:00
|
|
|
# include <sys/mman.h>
|
2001-05-18 23:38:46 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2006-07-26 08:57:44 +00:00
|
|
|
#if HAVE_SYS_LOADAVG_H
|
|
|
|
# include <sys/loadavg.h>
|
|
|
|
#endif
|
|
|
|
|
2000-02-11 15:59:30 +00:00
|
|
|
#ifdef PHP_WIN32
|
2001-08-29 16:00:30 +00:00
|
|
|
# include "win32/unistd.h"
|
1999-04-17 00:37:12 +00:00
|
|
|
#endif
|
|
|
|
|
2003-12-22 16:00:52 +00:00
|
|
|
#ifndef INADDR_NONE
|
2014-08-25 17:24:55 +00:00
|
|
|
#define INADDR_NONE ((zend_ulong) -1)
|
2003-12-22 16:00:52 +00:00
|
|
|
#endif
|
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
#include "zend_globals.h"
|
1999-04-17 00:37:12 +00:00
|
|
|
#include "php_globals.h"
|
1999-04-26 17:26:37 +00:00
|
|
|
#include "SAPI.h"
|
2000-09-01 16:10:17 +00:00
|
|
|
#include "php_ticks.h"
|
|
|
|
|
1999-11-28 00:31:02 +00:00
|
|
|
#ifdef ZTS
|
2006-01-28 06:18:01 +00:00
|
|
|
PHPAPI int basic_globals_id;
|
1999-11-28 00:31:02 +00:00
|
|
|
#else
|
2006-01-28 06:18:01 +00:00
|
|
|
PHPAPI php_basic_globals basic_globals;
|
1999-08-06 08:56:15 +00:00
|
|
|
#endif
|
|
|
|
|
2000-10-13 00:09:31 +00:00
|
|
|
#include "php_fopen_wrappers.h"
|
2003-02-28 19:53:21 +00:00
|
|
|
#include "streamsfuncs.h"
|
2000-10-13 00:09:31 +00:00
|
|
|
|
2005-12-07 17:36:17 +00:00
|
|
|
static zend_class_entry *incomplete_class_entry = NULL;
|
|
|
|
|
2000-09-01 16:10:17 +00:00
|
|
|
typedef struct _user_tick_function_entry {
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *arguments;
|
2000-09-01 16:10:17 +00:00
|
|
|
int arg_count;
|
2002-07-16 14:14:22 +00:00
|
|
|
int calling;
|
2000-09-01 16:10:17 +00:00
|
|
|
} user_tick_function_entry;
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
/* some prototypes for local functions */
|
2014-02-10 08:18:01 +00:00
|
|
|
static void user_shutdown_function_dtor(zval *zv);
|
2000-09-01 16:10:17 +00:00
|
|
|
static void user_tick_function_dtor(user_tick_function_entry *tick_function_entry);
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
static HashTable basic_submodules;
|
|
|
|
|
2004-11-15 21:13:25 +00:00
|
|
|
#undef sprintf
|
2001-08-29 23:53:22 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ arginfo */
|
|
|
|
/* {{{ main/main.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_set_time_limit, 0)
|
|
|
|
ZEND_ARG_INFO(0, seconds)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2011-02-03 16:47:28 +00:00
|
|
|
|
|
|
|
/* {{{ main/sapi.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_header_register_callback, 0)
|
|
|
|
ZEND_ARG_INFO(0, callback)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ main/output.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, user_function)
|
|
|
|
ZEND_ARG_INFO(0, chunk_size)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_flush, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_clean, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_end_flush, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_end_clean, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_get_flush, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_get_clean, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_get_contents, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_get_level, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_get_length, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ob_list_handlers, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_get_status, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, full_status)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_implicit_flush, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, flag)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_output_reset_rewrite_vars, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_output_add_rewrite_var, 0)
|
|
|
|
ZEND_ARG_INFO(0, name)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ main/streams/userspace.c */
|
2007-07-09 17:27:24 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_wrapper_register, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, protocol)
|
|
|
|
ZEND_ARG_INFO(0, classname)
|
2007-07-09 17:27:24 +00:00
|
|
|
ZEND_ARG_INFO(0, flags)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_unregister, 0)
|
|
|
|
ZEND_ARG_INFO(0, protocol)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_wrapper_restore, 0)
|
|
|
|
ZEND_ARG_INFO(0, protocol)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ array.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_krsort, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, sort_flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ksort, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, sort_flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_count, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_natsort, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_natcasesort, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_asort, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, sort_flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_arsort, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, sort_flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sort, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, sort_flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_rsort, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, sort_flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_usort, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, cmp_function)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_uasort, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, cmp_function)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_uksort, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, cmp_function)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_end, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_prev, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_next, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_reset, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_current, 0)
|
2015-02-24 14:40:25 +00:00
|
|
|
ZEND_ARG_INFO(0, arg)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_key, 0)
|
2015-02-24 14:40:25 +00:00
|
|
|
ZEND_ARG_INFO(0, arg)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_min, 0, 0, 1)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, args)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_max, 0, 0, 1)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, args)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, funcname)
|
|
|
|
ZEND_ARG_INFO(0, userdata)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_walk_recursive, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(1, input) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, funcname)
|
|
|
|
ZEND_ARG_INFO(0, userdata)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_in_array, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
|
|
|
|
ZEND_ARG_INFO(0, strict)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_search, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, haystack) /* ARRAY_INFO(0, haystack, 0) */
|
|
|
|
ZEND_ARG_INFO(0, strict)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_extract, 0, 0, 1)
|
2008-11-26 04:08:19 +00:00
|
|
|
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arg) /* ARRAY_INFO(0, arg, 0) */
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, extract_type)
|
|
|
|
ZEND_ARG_INFO(0, prefix)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_compact, 0, 0, 1)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, var_names)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_fill, 0)
|
|
|
|
ZEND_ARG_INFO(0, start_key)
|
|
|
|
ZEND_ARG_INFO(0, num)
|
|
|
|
ZEND_ARG_INFO(0, val)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-07-15 10:21:10 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_fill_keys, 0)
|
|
|
|
ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
|
|
|
|
ZEND_ARG_INFO(0, val)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_range, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, low)
|
|
|
|
ZEND_ARG_INFO(0, high)
|
|
|
|
ZEND_ARG_INFO(0, step)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_shuffle, 0)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-01-07 15:10:12 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_push, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, vars)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_pop, 0)
|
|
|
|
ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_shift, 0)
|
|
|
|
ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-01-07 15:10:12 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unshift, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(1, stack) /* ARRAY_INFO(1, stack, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, vars)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_splice, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(1, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_ARG_INFO(0, replacement) /* ARRAY_INFO(0, arg, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(1, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_ARG_INFO(0, preserve_keys)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-03-25 17:53:57 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
2014-08-16 15:31:40 +00:00
|
|
|
|
2018-03-25 17:53:57 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-03-25 17:53:57 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 1)
|
2008-07-31 20:18:17 +00:00
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2008-07-31 20:18:17 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-03-25 17:53:57 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 1)
|
2008-07-31 20:18:17 +00:00
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2008-07-31 20:18:17 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_keys, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, search_value)
|
|
|
|
ZEND_ARG_INFO(0, strict)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-07-17 08:29:55 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_key_first, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_key_last, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_values, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_count_values, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2012-04-14 04:17:56 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_column, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
2013-01-11 22:57:11 +00:00
|
|
|
ZEND_ARG_INFO(0, column_key)
|
|
|
|
ZEND_ARG_INFO(0, index_key)
|
2012-04-14 04:17:56 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reverse, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, preserve_keys)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_pad, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, pad_size)
|
|
|
|
ZEND_ARG_INFO(0, pad_value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_flip, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_change_key_case, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, input) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, case)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2015-11-24 05:45:16 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_unique, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
2015-11-24 05:45:16 +00:00
|
|
|
ZEND_ARG_INFO(0, flags)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_key, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_ukey, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_key_compare_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_data_compare_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_intersect_assoc, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_assoc, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_data_compare_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_intersect_uassoc, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_key_compare_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_uintersect_uassoc, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_data_compare_func)
|
|
|
|
ZEND_ARG_INFO(0, callback_key_compare_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_key, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_diff_ukey, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_key_comp_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_udiff, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1)
|
|
|
|
ZEND_ARG_INFO(0, arr2)
|
|
|
|
ZEND_ARG_INFO(0, callback_data_comp_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_diff_assoc, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_diff_uassoc, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_data_comp_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_assoc, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_key_comp_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_udiff_uassoc, 0)
|
|
|
|
ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
|
|
|
ZEND_ARG_INFO(0, arr2) /* ARRAY_INFO(0, arg2, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback_data_comp_func)
|
|
|
|
ZEND_ARG_INFO(0, callback_key_comp_func)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_multisort, 0, 0, 1)
|
2006-06-30 18:17:38 +00:00
|
|
|
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, arr1) /* ARRAY_INFO(0, arg1, 0) */
|
2014-11-14 12:36:56 +00:00
|
|
|
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_order)
|
|
|
|
ZEND_ARG_INFO(ZEND_SEND_PREFER_REF, sort_flags)
|
|
|
|
ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, arr2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_rand, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, num_req)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_sum, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_product, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_reduce, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback)
|
|
|
|
ZEND_ARG_INFO(0, initial)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_filter, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, callback)
|
2013-02-21 08:35:48 +00:00
|
|
|
ZEND_ARG_INFO(0, use_keys)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2009-06-20 06:07:35 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_map, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, callback)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, arrays)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-09-19 23:44:30 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_key_exists, 0)
|
|
|
|
ZEND_ARG_INFO(0, key)
|
|
|
|
ZEND_ARG_INFO(0, search)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_array_chunk, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, arg) /* ARRAY_INFO(0, arg, 0) */
|
|
|
|
ZEND_ARG_INFO(0, size)
|
|
|
|
ZEND_ARG_INFO(0, preserve_keys)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_array_combine, 0)
|
|
|
|
ZEND_ARG_INFO(0, keys) /* ARRAY_INFO(0, keys, 0) */
|
|
|
|
ZEND_ARG_INFO(0, values) /* ARRAY_INFO(0, values, 0) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ basic_functions.c */
|
2008-07-20 14:28:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_gpc, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_get_magic_quotes_runtime, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_constant, 0)
|
|
|
|
ZEND_ARG_INFO(0, const_name)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#ifdef HAVE_INET_NTOP
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_inet_ntop, 0)
|
|
|
|
ZEND_ARG_INFO(0, in_addr)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_INET_PTON
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_inet_pton, 0)
|
|
|
|
ZEND_ARG_INFO(0, ip_address)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ip2long, 0)
|
|
|
|
ZEND_ARG_INFO(0, ip_address)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0)
|
|
|
|
ZEND_ARG_INFO(0, proper_address)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-21 04:04:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_getenv, 0, 0, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, varname)
|
2016-07-20 10:09:17 +00:00
|
|
|
ZEND_ARG_INFO(0, local_only)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#ifdef HAVE_PUTENV
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_putenv, 0)
|
|
|
|
ZEND_ARG_INFO(0, setting)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_getopt, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, options)
|
|
|
|
ZEND_ARG_INFO(0, opts) /* ARRAY_INFO(0, opts, 1) */
|
2016-05-29 17:44:16 +00:00
|
|
|
ZEND_ARG_INFO(1, optind)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_flush, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_sleep, 0)
|
|
|
|
ZEND_ARG_INFO(0, seconds)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_usleep, 0)
|
|
|
|
ZEND_ARG_INFO(0, micro_seconds)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if HAVE_NANOSLEEP
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_time_nanosleep, 0)
|
|
|
|
ZEND_ARG_INFO(0, seconds)
|
|
|
|
ZEND_ARG_INFO(0, nanoseconds)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_time_sleep_until, 0)
|
|
|
|
ZEND_ARG_INFO(0, timestamp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_get_current_user, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_get_cfg_var, 0)
|
|
|
|
ZEND_ARG_INFO(0, option_name)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_log, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, message)
|
|
|
|
ZEND_ARG_INFO(0, message_type)
|
|
|
|
ZEND_ARG_INFO(0, destination)
|
|
|
|
ZEND_ARG_INFO(0, extra_headers)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-07-19 12:25:46 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_get_last, 0, 0, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2015-03-03 09:48:03 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_error_clear_last, 0, 0, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, function_name)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, parameters)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2007-11-02 19:40:39 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, function_name)
|
|
|
|
ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-04-07 10:44:59 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, function_name)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, parameters)
|
2008-04-07 10:44:59 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call_array, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, function_name)
|
|
|
|
ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_register_shutdown_function, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, function_name)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, parameters)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_file, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, file_name)
|
|
|
|
ZEND_ARG_INFO(0, return)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_php_strip_whitespace, 0)
|
|
|
|
ZEND_ARG_INFO(0, file_name)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_highlight_string, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, string)
|
|
|
|
ZEND_ARG_INFO(0, return)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ini_get, 0)
|
|
|
|
ZEND_ARG_INFO(0, varname)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ini_get_all, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, extension)
|
2017-04-11 06:27:17 +00:00
|
|
|
ZEND_ARG_INFO(0, details)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ini_set, 0)
|
|
|
|
ZEND_ARG_INFO(0, varname)
|
|
|
|
ZEND_ARG_INFO(0, newvalue)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ini_restore, 0)
|
|
|
|
ZEND_ARG_INFO(0, varname)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_set_include_path, 0)
|
|
|
|
ZEND_ARG_INFO(0, new_include_path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_get_include_path, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_restore_include_path, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_print_r, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_ARG_INFO(0, return)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_connection_aborted, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_connection_status, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ignore_user_abort, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if HAVE_GETSERVBYNAME
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getservbyname, 0)
|
|
|
|
ZEND_ARG_INFO(0, service)
|
|
|
|
ZEND_ARG_INFO(0, protocol)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_GETSERVBYPORT
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getservbyport, 0)
|
|
|
|
ZEND_ARG_INFO(0, port)
|
|
|
|
ZEND_ARG_INFO(0, protocol)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_GETPROTOBYNAME
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getprotobyname, 0)
|
|
|
|
ZEND_ARG_INFO(0, name)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAVE_GETPROTOBYNUMBER
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getprotobynumber, 0)
|
|
|
|
ZEND_ARG_INFO(0, proto)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_register_tick_function, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, function_name)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, parameters)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_unregister_tick_function, 0)
|
|
|
|
ZEND_ARG_INFO(0, function_name)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_uploaded_file, 0)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_move_uploaded_file, 0)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_ARG_INFO(0, new_path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_file, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, process_sections)
|
2007-09-28 02:05:10 +00:00
|
|
|
ZEND_ARG_INFO(0, scanner_mode)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-11-05 21:35:02 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_ini_string, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, ini_string)
|
|
|
|
ZEND_ARG_INFO(0, process_sections)
|
|
|
|
ZEND_ARG_INFO(0, scanner_mode)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-04-15 08:44:21 +00:00
|
|
|
#if ZEND_DEBUG
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_config_get_hash, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_GETLOADAVG
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ assert.c */
|
2015-06-24 02:40:49 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_assert, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, assertion)
|
2015-06-24 02:40:49 +00:00
|
|
|
ZEND_ARG_INFO(0, description)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_assert_options, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, what)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ base64.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_base64_encode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_base64_decode, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, strict)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ browscap.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_browser, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, browser_name)
|
|
|
|
ZEND_ARG_INFO(0, return_array)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ crc32.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_crc32, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ crypt.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_crypt, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, salt)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ cyr_convert.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_convert_cyr_string, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, from)
|
|
|
|
ZEND_ARG_INFO(0, to)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ datetime.c */
|
|
|
|
#if HAVE_STRPTIME
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strptime, 0)
|
|
|
|
ZEND_ARG_INFO(0, timestamp)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ dir.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_opendir, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, directory)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_closedir, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, dir_handle)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_chroot, 0)
|
|
|
|
ZEND_ARG_INFO(0, directory)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_chdir, 0)
|
|
|
|
ZEND_ARG_INFO(0, directory)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getcwd, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_rewinddir, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, dir_handle)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_readdir, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, dir_handle)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#ifdef HAVE_GLOB
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_glob, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, pattern)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_scandir, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, dir)
|
|
|
|
ZEND_ARG_INFO(0, sorting_order)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ dns.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_gethostbyaddr, 0)
|
|
|
|
ZEND_ARG_INFO(0, ip_address)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_gethostbyname, 0)
|
|
|
|
ZEND_ARG_INFO(0, hostname)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_gethostbynamel, 0)
|
|
|
|
ZEND_ARG_INFO(0, hostname)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-12-31 14:30:38 +00:00
|
|
|
#ifdef HAVE_GETHOSTNAME
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
2017-11-21 15:04:37 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_net_get_interfaces, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2017-08-29 20:03:56 +00:00
|
|
|
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, host)
|
|
|
|
ZEND_ARG_INFO(0, type)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2009-08-11 22:07:35 +00:00
|
|
|
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
|
2010-10-11 02:48:23 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, hostname)
|
|
|
|
ZEND_ARG_INFO(0, type)
|
2010-10-11 02:48:23 +00:00
|
|
|
ZEND_ARG_ARRAY_INFO(1, authns, 1)
|
|
|
|
ZEND_ARG_ARRAY_INFO(1, addtl, 1)
|
|
|
|
ZEND_ARG_INFO(0, raw)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, hostname)
|
|
|
|
ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */
|
|
|
|
ZEND_ARG_INFO(1, weight) /* ARRAY_INFO(1, weight, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
# endif
|
2009-01-06 20:48:21 +00:00
|
|
|
|
2017-08-29 20:03:56 +00:00
|
|
|
#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
2009-01-06 20:48:21 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ exec.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, command)
|
|
|
|
ZEND_ARG_INFO(1, output) /* ARRAY_INFO(1, output, 1) */
|
|
|
|
ZEND_ARG_INFO(1, return_value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_system, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, command)
|
|
|
|
ZEND_ARG_INFO(1, return_value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_passthru, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, command)
|
|
|
|
ZEND_ARG_INFO(1, return_value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_escapeshellcmd, 0)
|
|
|
|
ZEND_ARG_INFO(0, command)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_escapeshellarg, 0)
|
|
|
|
ZEND_ARG_INFO(0, arg)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_shell_exec, 0)
|
|
|
|
ZEND_ARG_INFO(0, cmd)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#ifdef HAVE_NICE
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_proc_nice, 0)
|
|
|
|
ZEND_ARG_INFO(0, priority)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ file.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_flock, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, operation)
|
|
|
|
ZEND_ARG_INFO(1, wouldblock)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_meta_tags, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, use_include_path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_file_get_contents, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_ARG_INFO(0, maxlen)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_file_put_contents, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_file, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_tempnam, 0)
|
|
|
|
ZEND_ARG_INFO(0, dir)
|
|
|
|
ZEND_ARG_INFO(0, prefix)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_tmpfile, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fopen, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_ARG_INFO(0, use_include_path)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fclose, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_popen, 0)
|
|
|
|
ZEND_ARG_INFO(0, command)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_pclose, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_feof, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fgets, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fgetc, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetss, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_ARG_INFO(0, allowable_tags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fscanf, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(1, vars)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fwrite, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fflush, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_rewind, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ftell, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fseek, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_ARG_INFO(0, whence)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_mkdir, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, pathname)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_ARG_INFO(0, recursive)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_rmdir, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, dirname)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_readfile, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_umask, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, mask)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fpassthru, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_rename, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, old_name)
|
|
|
|
ZEND_ARG_INFO(0, new_name)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_unlink, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ftruncate, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, size)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
2014-01-18 16:25:53 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_copy, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, source_file)
|
|
|
|
ZEND_ARG_INFO(0, destination_file)
|
2010-08-16 21:56:35 +00:00
|
|
|
ZEND_ARG_INFO(0, context)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fread, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fputcsv, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, fields) /* ARRAY_INFO(0, fields, 1) */
|
|
|
|
ZEND_ARG_INFO(0, delimiter)
|
|
|
|
ZEND_ARG_INFO(0, enclosure)
|
2017-02-23 03:02:23 +00:00
|
|
|
ZEND_ARG_INFO(0, escape_char)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_ARG_INFO(0, delimiter)
|
|
|
|
ZEND_ARG_INFO(0, enclosure)
|
2011-02-08 16:29:34 +00:00
|
|
|
ZEND_ARG_INFO(0, escape)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2017-08-29 20:03:56 +00:00
|
|
|
#if HAVE_REALPATH || defined(ZTS)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_FNMATCH
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, pattern)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
2007-09-28 02:05:10 +00:00
|
|
|
|
2006-12-09 18:00:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_sys_get_temp_dir, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ filestat.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_disk_total_space, 0)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_disk_free_space, 0)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_chgrp, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, group)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_chown, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, user)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if HAVE_LCHOWN
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_lchgrp, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, group)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_lchown, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, user)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_chmod, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if HAVE_UTIME
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_touch, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, time)
|
|
|
|
ZEND_ARG_INFO(0, atime)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
2008-08-07 09:25:33 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_clearstatcache, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, clear_realpath_cache)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2009-12-08 01:35:08 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_size, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_get, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fileinode, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_filesize, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fileowner, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_filegroup, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fileatime, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_filemtime, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_filectime, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_filetype, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_writable, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_readable, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_executable, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_file, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_dir, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_link, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_file_exists, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_lstat, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stat, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ formatted_print.c */
|
2015-06-29 01:08:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sprintf, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, format)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, args)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_vsprintf, 0)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_printf, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, args)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_vprintf, 0)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fprintf, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, args)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_vfprintf, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_ARG_INFO(0, args) /* ARRAY_INFO(0, args, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ fsock.c */
|
2018-02-21 04:04:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_fsockopen, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, hostname)
|
|
|
|
ZEND_ARG_INFO(0, port)
|
|
|
|
ZEND_ARG_INFO(1, errno)
|
|
|
|
ZEND_ARG_INFO(1, errstr)
|
|
|
|
ZEND_ARG_INFO(0, timeout)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-21 04:04:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_pfsockopen, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, hostname)
|
|
|
|
ZEND_ARG_INFO(0, port)
|
|
|
|
ZEND_ARG_INFO(1, errno)
|
|
|
|
ZEND_ARG_INFO(1, errstr)
|
|
|
|
ZEND_ARG_INFO(0, timeout)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ ftok.c */
|
|
|
|
#if HAVE_FTOK
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ftok, 0)
|
|
|
|
ZEND_ARG_INFO(0, pathname)
|
|
|
|
ZEND_ARG_INFO(0, proj)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ head.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_header, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, header)
|
|
|
|
ZEND_ARG_INFO(0, replace)
|
|
|
|
ZEND_ARG_INFO(0, http_response_code)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
Added header_remove() (chsc at peytz dotdk, Arnaud)
[DOC] proto void header_remove([string header_name])
Removes an HTTP header previously set using header()
The header_name parameter is optionnal, all headers are
removed if it is not set
[SAPIs] The header_handler callback in sapi_module_struct has
been changed, it now take a new argument.
When it is set to SAPI_HEADER_DELETE, sapi_header->header is
the name of an header, header_handler has to delete it.
When it is set to SAPI_HEADER_DELETE_ALL, header_handler has
to delete all headers.
When sapi_header_op_enum is SAPI_HEADER_ADD or _REPLACE,
sapi_header->header is in the form "Name: value", header_handler
has to add or replace the given header.
In all cases, header_handler must not free sapi_header or
sapi_header->header. SAPI_HEADER_ADD must be returned if the
header has been added or replaced, or 0 in other cases.
2008-11-13 10:14:04 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_header_remove, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, name)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_setcookie, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, name)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
2018-07-19 01:40:39 +00:00
|
|
|
ZEND_ARG_INFO(0, expires_or_options)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_ARG_INFO(0, domain)
|
|
|
|
ZEND_ARG_INFO(0, secure)
|
2015-02-28 08:37:14 +00:00
|
|
|
ZEND_ARG_INFO(0, httponly)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_setrawcookie, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, name)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
2018-07-19 01:40:39 +00:00
|
|
|
ZEND_ARG_INFO(0, expires_or_options)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_ARG_INFO(0, domain)
|
|
|
|
ZEND_ARG_INFO(0, secure)
|
2015-02-28 08:37:14 +00:00
|
|
|
ZEND_ARG_INFO(0, httponly)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_headers_sent, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(1, file)
|
|
|
|
ZEND_ARG_INFO(1, line)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_headers_list, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
2010-08-09 13:10:32 +00:00
|
|
|
|
2011-07-12 03:56:32 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_http_response_code, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, response_code)
|
2010-08-09 13:10:32 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
2018-01-07 14:55:12 +00:00
|
|
|
/* {{{ hrtime.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_hrtime, 0)
|
|
|
|
ZEND_ARG_INFO(0, get_as_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ html.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, string)
|
|
|
|
ZEND_ARG_INFO(0, quote_style)
|
2015-04-14 12:17:08 +00:00
|
|
|
ZEND_ARG_INFO(0, encoding)
|
2007-05-22 15:38:27 +00:00
|
|
|
ZEND_ARG_INFO(0, double_encode)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlspecialchars_decode, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, string)
|
|
|
|
ZEND_ARG_INFO(0, quote_style)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_html_entity_decode, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, string)
|
|
|
|
ZEND_ARG_INFO(0, quote_style)
|
2015-04-14 12:17:08 +00:00
|
|
|
ZEND_ARG_INFO(0, encoding)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_htmlentities, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, string)
|
|
|
|
ZEND_ARG_INFO(0, quote_style)
|
2015-04-14 12:17:08 +00:00
|
|
|
ZEND_ARG_INFO(0, encoding)
|
2007-05-22 15:38:27 +00:00
|
|
|
ZEND_ARG_INFO(0, double_encode)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_html_translation_table, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, table)
|
|
|
|
ZEND_ARG_INFO(0, quote_style)
|
2015-04-14 12:17:08 +00:00
|
|
|
ZEND_ARG_INFO(0, encoding)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ http.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_http_build_query, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, formdata)
|
|
|
|
ZEND_ARG_INFO(0, prefix)
|
|
|
|
ZEND_ARG_INFO(0, arg_separator)
|
2011-01-08 02:21:44 +00:00
|
|
|
ZEND_ARG_INFO(0, enc_type)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ image.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_image_type_to_mime_type, 0)
|
|
|
|
ZEND_ARG_INFO(0, imagetype)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_image_type_to_extension, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, imagetype)
|
|
|
|
ZEND_ARG_INFO(0, include_dot)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_getimagesize, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, imagefile)
|
|
|
|
ZEND_ARG_INFO(1, info) /* ARRAY_INFO(1, info, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ info.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_phpinfo, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, what)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_phpversion, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, extension)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_phpcredits, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, flag)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_php_sapi_name, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2015-06-30 16:54:42 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_php_uname, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
2007-06-09 11:44:08 +00:00
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_php_ini_loaded_file, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ iptc.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_iptcembed, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, iptcdata)
|
|
|
|
ZEND_ARG_INFO(0, jpeg_file_name)
|
|
|
|
ZEND_ARG_INFO(0, spool)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_iptcparse, 0)
|
|
|
|
ZEND_ARG_INFO(0, iptcdata)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2015-02-24 09:54:36 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ lcg.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_lcg_value, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2015-02-24 09:54:36 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ levenshtein.c */
|
2015-02-24 09:54:36 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_levenshtein, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, str1)
|
|
|
|
ZEND_ARG_INFO(0, str2)
|
|
|
|
ZEND_ARG_INFO(0, cost_ins)
|
|
|
|
ZEND_ARG_INFO(0, cost_rep)
|
|
|
|
ZEND_ARG_INFO(0, cost_del)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ link.c */
|
2009-01-16 01:01:04 +00:00
|
|
|
#if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_readlink, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_linkinfo, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_symlink, 0)
|
|
|
|
ZEND_ARG_INFO(0, target)
|
|
|
|
ZEND_ARG_INFO(0, link)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_link, 0)
|
|
|
|
ZEND_ARG_INFO(0, target)
|
|
|
|
ZEND_ARG_INFO(0, link)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ mail.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ezmlm_hash, 0)
|
|
|
|
ZEND_ARG_INFO(0, addr)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_mail, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, to)
|
|
|
|
ZEND_ARG_INFO(0, subject)
|
|
|
|
ZEND_ARG_INFO(0, message)
|
|
|
|
ZEND_ARG_INFO(0, additional_headers)
|
|
|
|
ZEND_ARG_INFO(0, additional_parameters)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ math.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_abs, 0)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ceil, 0)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_floor, 0)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_round, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_ARG_INFO(0, precision)
|
2008-12-02 16:27:15 +00:00
|
|
|
ZEND_ARG_INFO(0, mode)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_sin, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_cos, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_tan, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_asin, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_acos, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_atan, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_atan2, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, y)
|
|
|
|
ZEND_ARG_INFO(0, x)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_sinh, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_cosh, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_tanh, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_asinh, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_acosh, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_atanh, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_pi, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_finite, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, val)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_infinite, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, val)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_nan, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, val)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_pow, 0)
|
|
|
|
ZEND_ARG_INFO(0, base)
|
|
|
|
ZEND_ARG_INFO(0, exponent)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_exp, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_expm1, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_log1p, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_log, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_ARG_INFO(0, base)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_log10, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-14 10:18:52 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_sqrt, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_hypot, 0)
|
|
|
|
ZEND_ARG_INFO(0, num1)
|
|
|
|
ZEND_ARG_INFO(0, num2)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_deg2rad, 0)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_rad2deg, 0)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_bindec, 0)
|
|
|
|
ZEND_ARG_INFO(0, binary_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_hexdec, 0)
|
|
|
|
ZEND_ARG_INFO(0, hexadecimal_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_octdec, 0)
|
|
|
|
ZEND_ARG_INFO(0, octal_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_decbin, 0)
|
|
|
|
ZEND_ARG_INFO(0, decimal_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_decoct, 0)
|
|
|
|
ZEND_ARG_INFO(0, decimal_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_dechex, 0)
|
|
|
|
ZEND_ARG_INFO(0, decimal_number)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_base_convert, 0)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_ARG_INFO(0, frombase)
|
|
|
|
ZEND_ARG_INFO(0, tobase)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_number_format, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, number)
|
|
|
|
ZEND_ARG_INFO(0, num_decimal_places)
|
2013-07-23 23:54:16 +00:00
|
|
|
ZEND_ARG_INFO(0, dec_separator)
|
|
|
|
ZEND_ARG_INFO(0, thousands_separator)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0)
|
|
|
|
ZEND_ARG_INFO(0, x)
|
|
|
|
ZEND_ARG_INFO(0, y)
|
|
|
|
ZEND_END_ARG_INFO()
|
2014-07-14 23:35:26 +00:00
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_intdiv, 0)
|
2015-10-06 15:12:48 +00:00
|
|
|
ZEND_ARG_INFO(0, dividend)
|
2014-07-14 23:35:26 +00:00
|
|
|
ZEND_ARG_INFO(0, divisor)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ md5.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_md5, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, raw_output)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_md5_file, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, raw_output)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ metaphone.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_metaphone, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, text)
|
|
|
|
ZEND_ARG_INFO(0, phones)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ microtime.c */
|
|
|
|
#ifdef HAVE_GETTIMEOFDAY
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_microtime, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, get_as_float)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_gettimeofday, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, get_as_float)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_GETRUSAGE
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_getrusage, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, who)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ pack.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_pack, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, args)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2017-01-26 06:58:08 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_unpack, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_ARG_INFO(0, input)
|
2016-12-19 08:13:02 +00:00
|
|
|
ZEND_ARG_INFO(0, offset)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ pageinfo.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getmyuid, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getmygid, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getmypid, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getmyinode, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_getlastmod, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2012-06-25 02:44:43 +00:00
|
|
|
/* {{{ password.c */
|
2012-09-12 16:15:33 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_password_hash, 0, 0, 2)
|
2012-06-25 02:44:43 +00:00
|
|
|
ZEND_ARG_INFO(0, password)
|
|
|
|
ZEND_ARG_INFO(0, algo)
|
|
|
|
ZEND_ARG_INFO(0, options)
|
|
|
|
ZEND_END_ARG_INFO()
|
2012-07-05 21:46:33 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_password_get_info, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, hash)
|
|
|
|
ZEND_END_ARG_INFO()
|
2012-09-17 15:10:59 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_password_needs_rehash, 0, 0, 2)
|
2012-07-05 20:22:49 +00:00
|
|
|
ZEND_ARG_INFO(0, hash)
|
|
|
|
ZEND_ARG_INFO(0, algo)
|
|
|
|
ZEND_ARG_INFO(0, options)
|
|
|
|
ZEND_END_ARG_INFO()
|
2012-06-25 02:44:43 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_password_verify, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, password)
|
|
|
|
ZEND_ARG_INFO(0, hash)
|
|
|
|
ZEND_END_ARG_INFO()
|
2018-10-15 18:58:34 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_password_algos, 0)
|
|
|
|
ZEND_END_ARG_INFO();
|
2012-06-25 02:44:43 +00:00
|
|
|
/* }}} */
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ proc_open.c */
|
|
|
|
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_terminate, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, process)
|
|
|
|
ZEND_ARG_INFO(0, signal)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_proc_close, 0)
|
|
|
|
ZEND_ARG_INFO(0, process)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_proc_get_status, 0)
|
|
|
|
ZEND_ARG_INFO(0, process)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_proc_open, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, command)
|
|
|
|
ZEND_ARG_INFO(0, descriptorspec) /* ARRAY_INFO(0, descriptorspec, 1) */
|
|
|
|
ZEND_ARG_INFO(1, pipes) /* ARRAY_INFO(1, pipes, 1) */
|
|
|
|
ZEND_ARG_INFO(0, cwd)
|
|
|
|
ZEND_ARG_INFO(0, env) /* ARRAY_INFO(0, env, 1) */
|
|
|
|
ZEND_ARG_INFO(0, other_options) /* ARRAY_INFO(0, other_options, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ quot_print.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_decode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2008-08-14 10:12:21 +00:00
|
|
|
/* {{{ quot_print.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_quoted_printable_encode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2016-07-05 10:54:07 +00:00
|
|
|
/* {{{ mt_rand.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_srand, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, seed)
|
2016-07-07 14:14:06 +00:00
|
|
|
ZEND_ARG_INFO(0, mode)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_mt_rand, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, min)
|
|
|
|
ZEND_ARG_INFO(0, max)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_mt_getrandmax, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2015-02-13 02:53:55 +00:00
|
|
|
/* {{{ random.c */
|
2017-06-08 06:50:20 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_random_bytes, 0, 0, 1)
|
2015-02-21 15:30:43 +00:00
|
|
|
ZEND_ARG_INFO(0, length)
|
2015-02-13 02:53:55 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2017-06-08 06:50:20 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_random_int, 0, 0, 2)
|
2015-02-21 15:30:43 +00:00
|
|
|
ZEND_ARG_INFO(0, min)
|
2015-02-13 02:53:55 +00:00
|
|
|
ZEND_ARG_INFO(0, max)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
2006-06-26 22:41:22 +00:00
|
|
|
/* {{{ sha1.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, raw_output)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sha1_file, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_ARG_INFO(0, raw_output)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ soundex.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_soundex, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ streamsfuncs.c */
|
|
|
|
#if HAVE_SOCKETPAIR
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_pair, 0)
|
|
|
|
ZEND_ARG_INFO(0, domain)
|
|
|
|
ZEND_ARG_INFO(0, type)
|
|
|
|
ZEND_ARG_INFO(0, protocol)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_client, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, remoteaddress)
|
|
|
|
ZEND_ARG_INFO(1, errcode)
|
|
|
|
ZEND_ARG_INFO(1, errstring)
|
|
|
|
ZEND_ARG_INFO(0, timeout)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_server, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, localaddress)
|
|
|
|
ZEND_ARG_INFO(1, errcode)
|
|
|
|
ZEND_ARG_INFO(1, errstring)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_accept, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, serverstream)
|
|
|
|
ZEND_ARG_INFO(0, timeout)
|
|
|
|
ZEND_ARG_INFO(1, peername)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_get_name, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, want_peer)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_sendto, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(0, target_addr)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_recvfrom, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, amount)
|
|
|
|
ZEND_ARG_INFO(0, flags)
|
|
|
|
ZEND_ARG_INFO(1, remote_addr)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_contents, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, source)
|
|
|
|
ZEND_ARG_INFO(0, maxlen)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_copy_to_stream, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, source)
|
|
|
|
ZEND_ARG_INFO(0, dest)
|
|
|
|
ZEND_ARG_INFO(0, maxlen)
|
|
|
|
ZEND_ARG_INFO(0, pos)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_get_meta_data, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_get_transports, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2009-12-24 13:12:03 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_resolve_include_path, 0)
|
|
|
|
ZEND_ARG_INFO(0, filename)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_is_local, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2007-11-20 22:17:01 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2016-08-29 09:57:53 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_isatty, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#ifdef PHP_WIN32
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_vt100_support, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, enable)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4)
|
|
|
|
ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */
|
|
|
|
ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */
|
|
|
|
ZEND_ARG_INFO(1, except_streams) /* ARRAY_INFO(1, except_streams, 1) */
|
|
|
|
ZEND_ARG_INFO(0, tv_sec)
|
|
|
|
ZEND_ARG_INFO(0, tv_usec)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_context_get_options, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream_or_context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_option, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream_or_context)
|
|
|
|
ZEND_ARG_INFO(0, wrappername)
|
|
|
|
ZEND_ARG_INFO(0, optionname)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_params, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream_or_context)
|
|
|
|
ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-11-13 05:47:47 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_params, 0, ZEND_RETURN_VALUE, 1)
|
|
|
|
ZEND_ARG_INFO(0, stream_or_context)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_get_default, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-08-16 10:57:56 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_context_set_default, 0)
|
|
|
|
ZEND_ARG_INFO(0, options)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_context_create, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, options) /* ARRAY_INFO(0, options, 1) */
|
2008-08-16 11:11:46 +00:00
|
|
|
ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_prepend, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, filtername)
|
|
|
|
ZEND_ARG_INFO(0, read_write)
|
|
|
|
ZEND_ARG_INFO(0, filterparams)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_filter_append, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, filtername)
|
|
|
|
ZEND_ARG_INFO(0, read_write)
|
|
|
|
ZEND_ARG_INFO(0, filterparams)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_remove, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream_filter)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_get_line, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, maxlen)
|
|
|
|
ZEND_ARG_INFO(0, ending)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_set_blocking, 0)
|
|
|
|
ZEND_ARG_INFO(0, socket)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
|
2015-06-25 17:30:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_set_timeout, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, seconds)
|
|
|
|
ZEND_ARG_INFO(0, microseconds)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
2010-04-12 08:25:50 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_set_read_buffer, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, buffer)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, buffer)
|
|
|
|
ZEND_END_ARG_INFO()
|
2015-01-03 09:22:58 +00:00
|
|
|
|
2011-02-19 01:28:37 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_set_chunk_size, 0)
|
|
|
|
ZEND_ARG_INFO(0, fp)
|
|
|
|
ZEND_ARG_INFO(0, chunk_size)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_socket_enable_crypto, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, enable)
|
|
|
|
ZEND_ARG_INFO(0, cryptokind)
|
|
|
|
ZEND_ARG_INFO(0, sessionstream)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-12-19 08:58:58 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SHUTDOWN
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_socket_shutdown, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, how)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ string.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_bin2hex, 0)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2011-06-03 00:12:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_hex2bin, 0)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, mask)
|
|
|
|
ZEND_ARG_INFO(0, start)
|
|
|
|
ZEND_ARG_INFO(0, len)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strcspn, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, mask)
|
|
|
|
ZEND_ARG_INFO(0, start)
|
|
|
|
ZEND_ARG_INFO(0, len)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#if HAVE_NL_LANGINFO
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_nl_langinfo, 0)
|
|
|
|
ZEND_ARG_INFO(0, item)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_STRCOLL
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strcoll, 0)
|
|
|
|
ZEND_ARG_INFO(0, str1)
|
|
|
|
ZEND_ARG_INFO(0, str2)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_trim, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, character_mask)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_rtrim, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, character_mask)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ltrim, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, character_mask)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_wordwrap, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, width)
|
|
|
|
ZEND_ARG_INFO(0, break)
|
|
|
|
ZEND_ARG_INFO(0, cut)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_explode, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, separator)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, limit)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_implode, 0)
|
|
|
|
ZEND_ARG_INFO(0, glue)
|
|
|
|
ZEND_ARG_INFO(0, pieces)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-21 04:04:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strtok, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, token)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strtoupper, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strtolower, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_basename, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_ARG_INFO(0, suffix)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2015-07-25 14:58:36 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_dirname, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, path)
|
2015-07-25 14:58:36 +00:00
|
|
|
ZEND_ARG_INFO(0, levels)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_pathinfo, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, path)
|
|
|
|
ZEND_ARG_INFO(0, options)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-02-01 12:28:44 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stristr, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
2008-02-01 12:28:44 +00:00
|
|
|
ZEND_ARG_INFO(0, part)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-02-01 12:28:44 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strstr, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
2008-02-01 12:28:44 +00:00
|
|
|
ZEND_ARG_INFO(0, part)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strpos, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_stripos, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strrpos, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strripos, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strrchr, 0)
|
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_chunk_split, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, chunklen)
|
|
|
|
ZEND_ARG_INFO(0, ending)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_substr, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, start)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_replace, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, replace)
|
|
|
|
ZEND_ARG_INFO(0, start)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_quotemeta, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ord, 0)
|
|
|
|
ZEND_ARG_INFO(0, character)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_chr, 0)
|
|
|
|
ZEND_ARG_INFO(0, codepoint)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_ucfirst, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-01-19 19:27:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_lcfirst, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
2015-01-03 09:22:58 +00:00
|
|
|
|
2014-07-02 14:22:11 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_ucwords, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, str)
|
2014-07-02 14:22:11 +00:00
|
|
|
ZEND_ARG_INFO(0, delimiters)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strtr, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, from)
|
|
|
|
ZEND_ARG_INFO(0, to)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strrev, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_similar_text, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, str1)
|
|
|
|
ZEND_ARG_INFO(0, str2)
|
|
|
|
ZEND_ARG_INFO(1, percent)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_addcslashes, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, charlist)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_addslashes, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stripcslashes, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stripslashes, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_str_replace, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, search)
|
|
|
|
ZEND_ARG_INFO(0, replace)
|
|
|
|
ZEND_ARG_INFO(0, subject)
|
|
|
|
ZEND_ARG_INFO(1, replace_count)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_str_ireplace, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, search)
|
|
|
|
ZEND_ARG_INFO(0, replace)
|
|
|
|
ZEND_ARG_INFO(0, subject)
|
|
|
|
ZEND_ARG_INFO(1, replace_count)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrev, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, max_chars_per_line)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_hebrevc, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, max_chars_per_line)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-08-14 09:41:16 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_nl2br, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, str)
|
2008-08-14 02:56:23 +00:00
|
|
|
ZEND_ARG_INFO(0, is_xhtml)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strip_tags, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, allowable_tags)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_setlocale, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, category)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, locales)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_str, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, encoded_string)
|
|
|
|
ZEND_ARG_INFO(1, result)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2008-11-02 18:24:34 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_str_getcsv, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, string)
|
|
|
|
ZEND_ARG_INFO(0, delimiter)
|
|
|
|
ZEND_ARG_INFO(0, enclosure)
|
|
|
|
ZEND_ARG_INFO(0, escape)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_str_repeat, 0)
|
|
|
|
ZEND_ARG_INFO(0, input)
|
|
|
|
ZEND_ARG_INFO(0, mult)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_count_chars, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, input)
|
|
|
|
ZEND_ARG_INFO(0, mode)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strnatcmp, 0)
|
|
|
|
ZEND_ARG_INFO(0, s1)
|
|
|
|
ZEND_ARG_INFO(0, s2)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_localeconv, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strnatcasecmp, 0)
|
|
|
|
ZEND_ARG_INFO(0, s1)
|
|
|
|
ZEND_ARG_INFO(0, s2)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_count, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, needle)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_str_pad, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, input)
|
|
|
|
ZEND_ARG_INFO(0, pad_length)
|
|
|
|
ZEND_ARG_INFO(0, pad_string)
|
|
|
|
ZEND_ARG_INFO(0, pad_type)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sscanf, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
2013-09-26 16:39:17 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(1, vars)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_str_rot13, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_str_shuffle, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_str_word_count, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_ARG_INFO(0, charlist)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
#ifdef HAVE_STRFMON
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_money_format, 0)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_str_split, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, split_length)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2018-02-21 04:04:41 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_strpbrk, 0, 0, 2)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, haystack)
|
|
|
|
ZEND_ARG_INFO(0, char_list)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_substr_compare, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, main_str)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_ARG_INFO(0, offset)
|
|
|
|
ZEND_ARG_INFO(0, length)
|
|
|
|
ZEND_ARG_INFO(0, case_sensitivity)
|
|
|
|
ZEND_END_ARG_INFO()
|
2016-10-13 22:33:33 +00:00
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_utf8_encode, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_utf8_decode, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ syslog.c */
|
|
|
|
#ifdef HAVE_SYSLOG_H
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_openlog, 0)
|
|
|
|
ZEND_ARG_INFO(0, ident)
|
|
|
|
ZEND_ARG_INFO(0, option)
|
|
|
|
ZEND_ARG_INFO(0, facility)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_closelog, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_syslog, 0)
|
|
|
|
ZEND_ARG_INFO(0, priority)
|
|
|
|
ZEND_ARG_INFO(0, message)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ type.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_gettype, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_settype, 0)
|
|
|
|
ZEND_ARG_INFO(1, var)
|
|
|
|
ZEND_ARG_INFO(0, type)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_intval, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_ARG_INFO(0, base)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_floatval, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_strval, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2012-06-06 20:34:51 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_boolval, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_resource, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_bool, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2014-12-14 21:26:16 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_int, 0)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_float, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_string, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_array, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_object, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_numeric, 0)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_scalar, 0)
|
|
|
|
ZEND_ARG_INFO(0, value)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_is_callable, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_ARG_INFO(0, syntax_only)
|
|
|
|
ZEND_ARG_INFO(1, callable_name)
|
|
|
|
ZEND_END_ARG_INFO()
|
2016-06-03 22:42:12 +00:00
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_is_iterable, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
2018-01-19 22:01:40 +00:00
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_is_countable, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ uniqid.c */
|
|
|
|
#ifdef HAVE_GETTIMEOFDAY
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_uniqid, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, prefix)
|
|
|
|
ZEND_ARG_INFO(0, more_entropy)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
#endif
|
2008-08-03 12:15:55 +00:00
|
|
|
/* }}} */
|
|
|
|
/* {{{ url.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_parse_url, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, url)
|
|
|
|
ZEND_ARG_INFO(0, component)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_urlencode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_urldecode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_rawurlencode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_rawurldecode, 0)
|
|
|
|
ZEND_ARG_INFO(0, str)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_get_headers, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, url)
|
|
|
|
ZEND_ARG_INFO(0, format)
|
2015-03-29 23:08:39 +00:00
|
|
|
ZEND_ARG_INFO(0, context)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ user_filters.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_make_writeable, 0)
|
|
|
|
ZEND_ARG_INFO(0, brigade)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_prepend, 0)
|
|
|
|
ZEND_ARG_INFO(0, brigade)
|
|
|
|
ZEND_ARG_INFO(0, bucket)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_append, 0)
|
|
|
|
ZEND_ARG_INFO(0, brigade)
|
|
|
|
ZEND_ARG_INFO(0, bucket)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_bucket_new, 0)
|
|
|
|
ZEND_ARG_INFO(0, stream)
|
|
|
|
ZEND_ARG_INFO(0, buffer)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_get_filters, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_stream_filter_register, 0)
|
|
|
|
ZEND_ARG_INFO(0, filtername)
|
|
|
|
ZEND_ARG_INFO(0, classname)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ uuencode.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_convert_uuencode, 0)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_convert_uudecode, 0)
|
|
|
|
ZEND_ARG_INFO(0, data)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ var.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_var_dump, 0, 0, 1)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, vars)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_debug_zval_dump, 0, 0, 1)
|
2013-12-28 22:08:50 +00:00
|
|
|
ZEND_ARG_VARIADIC_INFO(0, vars)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_var_export, 0, 0, 1)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_ARG_INFO(0, return)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO(arginfo_serialize, 0)
|
|
|
|
ZEND_ARG_INFO(0, var)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2017-10-17 10:25:19 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_unserialize, 0, 0, 1)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_ARG_INFO(0, variable_representation)
|
2015-07-15 16:59:31 +00:00
|
|
|
ZEND_ARG_INFO(0, allowed_classes)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-07-25 16:41:04 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, real_usage)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
2006-07-25 16:41:04 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0)
|
|
|
|
ZEND_ARG_INFO(0, real_usage)
|
2006-06-26 22:41:22 +00:00
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
|
|
|
/* {{{ versioning.c */
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_version_compare, 0, 0, 2)
|
|
|
|
ZEND_ARG_INFO(0, ver1)
|
|
|
|
ZEND_ARG_INFO(0, ver2)
|
|
|
|
ZEND_ARG_INFO(0, oper)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
/* }}} */
|
Fixed the UTF-8 and long path support in the streams on Windows.
Since long the default PHP charset is UTF-8, however the Windows part is
out of step with this important point. The current implementation in PHP
doesn't technically permit to handle UTF-8 filepath and several other
things. Till now, only the ANSI compatible APIs are being used. Here is more
about it
https://msdn.microsoft.com/en-us/library/windows/desktop/dd317752%28v=vs.85%29.aspx
The patch fixes not only issues with multibyte filenames under
incompatible codepages, but indirectly also issues with some other multibyte
encodings like BIG5, Shift-JIS, etc. by providing a clean way to access
filenames in UTF-8. Below is a small list of issues from the bug tracker,
that are getting fixed:
https://bugs.php.net/63401
https://bugs.php.net/41199
https://bugs.php.net/50203
https://bugs.php.net/71509
https://bugs.php.net/64699
https://bugs.php.net/64506
https://bugs.php.net/30195
https://bugs.php.net/65358
https://bugs.php.net/61315
https://bugs.php.net/70943
https://bugs.php.net/70903
https://bugs.php.net/63593
https://bugs.php.net/54977
https://bugs.php.net/54028
https://bugs.php.net/43148
https://bugs.php.net/30730
https://bugs.php.net/33350
https://bugs.php.net/35300
https://bugs.php.net/46990
https://bugs.php.net/61309
https://bugs.php.net/69333
https://bugs.php.net/45517
https://bugs.php.net/70551
https://bugs.php.net/50197
https://bugs.php.net/72200
https://bugs.php.net/37672
Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow
and Github. Some of the bugs are pretty recent, some descend to early
2000th, but the user comments in there last even till today. Just for example,
bug #30195 was opened in 2004, the latest comment in there was made in 2014. It
is certain, that these bugs descend not only to pure PHP use cases, but get also
redirected from the popular PHP based projects. Given the modern systems (and
those supported by PHP) are always based on NTFS, there is no excuse to keep
these issues unresolved.
The internalization approach on Windows is in many ways different from
UNIX and Linux, while it supports and is based on Unicode. It depends on the
current system code page, APIs used and exact kind how the binary was compiled
The locale doesn't affect the way Unicode or ANSI API work. PHP in particular
is being compiled without _UNICODE defined and this is conditioned by the
way we handle strings. Here is more about it
https://msdn.microsoft.com/en-us/library/tsbaswba.aspx
However, with any system code page ANSI functions automatically convert
paths to UTF-16. Paths in some encodings incompatible with the
current system code page, won't work correctly with ANSI APIs. PHP
till now only uses the ANSI Windows APIs.
For example, on a system with the current code page 1252, the paths
in cp1252 are supported and transparently converted to UTF-16 by the
ANSI functions. Once one wants to handle a filepath encoded with cp932 on
that particular system, an ANSI or a POSIX compatible function used in
PHP will produce an erroneous result. When trying to convert that cp932 path
to UTF-8 and passing to the ANSI functions, an ANSI function would
likely interpret the UTF-8 string as some string in the current code page and
create a filepath that represents every single byte of the UTF-8 string.
These behaviors are not only broken but also disregard the documented
INI settings.
This patch solves the issies with the multibyte paths on Windows by
intelligently enforcing the usage of the Unicode aware APIs. For
functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments
will be converted to UTF-16 wide chars. For functions returning Unicode
aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is
converted back to char's depending on the current PHP charset settings,
either to the current ANSI codepage (this is the behavior prior to this patch)
or to UTF-8 (the default behavior).
In a particular case, users might have to explicitly set
internal_encoding or default_charset, if filenames in ANSI codepage are
necessary. Current tests show no regressions and witness that this will be an
exotic case, the current default UTF-8 encoding is compatible with any
supported system. The dependency libraries are long switching to Unicode APIs,
so some tests were also added for extensions not directly related to streams.
At large, the patch brings over 150 related tests into the core. Those target
and was run on various environments with European, Asian, etc. codepages.
General PHP frameworks was tested and showed no regressions.
The impact on the current C code base is low, the most places affected
are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c
and plain_wrapper.c. The actual implementation of the most of the wide
char supporting functionality is in win32/ioutil.* and win32/codepage.*,
several low level functionsare extended in place to avoid reimplementation for
now. No performance impact was sighted. As previously mentioned, the ANSI APIs
used prior the patch perform Unicode conversions internally. Using the
Unicode APIs directly while doing custom conversions just retains the status
quo. The ways to optimize it are open (fe. by implementing caching for the
strings converted to wide variants).
The long path implementation is user transparent. If a path exceeds the
length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN
is set to 2048 bytes.
Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas
and testing.
Thanks.
2016-06-20 07:32:19 +00:00
|
|
|
/* {{{ win32/codepage.c */
|
2016-06-28 08:37:51 +00:00
|
|
|
#ifdef PHP_WIN32
|
Fixed the UTF-8 and long path support in the streams on Windows.
Since long the default PHP charset is UTF-8, however the Windows part is
out of step with this important point. The current implementation in PHP
doesn't technically permit to handle UTF-8 filepath and several other
things. Till now, only the ANSI compatible APIs are being used. Here is more
about it
https://msdn.microsoft.com/en-us/library/windows/desktop/dd317752%28v=vs.85%29.aspx
The patch fixes not only issues with multibyte filenames under
incompatible codepages, but indirectly also issues with some other multibyte
encodings like BIG5, Shift-JIS, etc. by providing a clean way to access
filenames in UTF-8. Below is a small list of issues from the bug tracker,
that are getting fixed:
https://bugs.php.net/63401
https://bugs.php.net/41199
https://bugs.php.net/50203
https://bugs.php.net/71509
https://bugs.php.net/64699
https://bugs.php.net/64506
https://bugs.php.net/30195
https://bugs.php.net/65358
https://bugs.php.net/61315
https://bugs.php.net/70943
https://bugs.php.net/70903
https://bugs.php.net/63593
https://bugs.php.net/54977
https://bugs.php.net/54028
https://bugs.php.net/43148
https://bugs.php.net/30730
https://bugs.php.net/33350
https://bugs.php.net/35300
https://bugs.php.net/46990
https://bugs.php.net/61309
https://bugs.php.net/69333
https://bugs.php.net/45517
https://bugs.php.net/70551
https://bugs.php.net/50197
https://bugs.php.net/72200
https://bugs.php.net/37672
Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow
and Github. Some of the bugs are pretty recent, some descend to early
2000th, but the user comments in there last even till today. Just for example,
bug #30195 was opened in 2004, the latest comment in there was made in 2014. It
is certain, that these bugs descend not only to pure PHP use cases, but get also
redirected from the popular PHP based projects. Given the modern systems (and
those supported by PHP) are always based on NTFS, there is no excuse to keep
these issues unresolved.
The internalization approach on Windows is in many ways different from
UNIX and Linux, while it supports and is based on Unicode. It depends on the
current system code page, APIs used and exact kind how the binary was compiled
The locale doesn't affect the way Unicode or ANSI API work. PHP in particular
is being compiled without _UNICODE defined and this is conditioned by the
way we handle strings. Here is more about it
https://msdn.microsoft.com/en-us/library/tsbaswba.aspx
However, with any system code page ANSI functions automatically convert
paths to UTF-16. Paths in some encodings incompatible with the
current system code page, won't work correctly with ANSI APIs. PHP
till now only uses the ANSI Windows APIs.
For example, on a system with the current code page 1252, the paths
in cp1252 are supported and transparently converted to UTF-16 by the
ANSI functions. Once one wants to handle a filepath encoded with cp932 on
that particular system, an ANSI or a POSIX compatible function used in
PHP will produce an erroneous result. When trying to convert that cp932 path
to UTF-8 and passing to the ANSI functions, an ANSI function would
likely interpret the UTF-8 string as some string in the current code page and
create a filepath that represents every single byte of the UTF-8 string.
These behaviors are not only broken but also disregard the documented
INI settings.
This patch solves the issies with the multibyte paths on Windows by
intelligently enforcing the usage of the Unicode aware APIs. For
functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments
will be converted to UTF-16 wide chars. For functions returning Unicode
aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is
converted back to char's depending on the current PHP charset settings,
either to the current ANSI codepage (this is the behavior prior to this patch)
or to UTF-8 (the default behavior).
In a particular case, users might have to explicitly set
internal_encoding or default_charset, if filenames in ANSI codepage are
necessary. Current tests show no regressions and witness that this will be an
exotic case, the current default UTF-8 encoding is compatible with any
supported system. The dependency libraries are long switching to Unicode APIs,
so some tests were also added for extensions not directly related to streams.
At large, the patch brings over 150 related tests into the core. Those target
and was run on various environments with European, Asian, etc. codepages.
General PHP frameworks was tested and showed no regressions.
The impact on the current C code base is low, the most places affected
are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c
and plain_wrapper.c. The actual implementation of the most of the wide
char supporting functionality is in win32/ioutil.* and win32/codepage.*,
several low level functionsare extended in place to avoid reimplementation for
now. No performance impact was sighted. As previously mentioned, the ANSI APIs
used prior the patch perform Unicode conversions internally. Using the
Unicode APIs directly while doing custom conversions just retains the status
quo. The ways to optimize it are open (fe. by implementing caching for the
strings converted to wide variants).
The long path implementation is user transparent. If a path exceeds the
length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN
is set to 2048 bytes.
Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas
and testing.
Thanks.
2016-06-20 07:32:19 +00:00
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_set, 0, 0, 1)
|
|
|
|
ZEND_ARG_TYPE_INFO(0, code_page, IS_LONG, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_get, 0, 0, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_is_utf8, 0, 0, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
|
|
|
|
|
|
|
ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_cp_conv, 0, 0, 3)
|
|
|
|
ZEND_ARG_INFO(0, in_codepage)
|
|
|
|
ZEND_ARG_INFO(0, out_codepage)
|
|
|
|
ZEND_ARG_TYPE_INFO(0, subject, IS_STRING, 0)
|
|
|
|
ZEND_END_ARG_INFO()
|
2016-06-28 08:37:51 +00:00
|
|
|
#endif
|
Fixed the UTF-8 and long path support in the streams on Windows.
Since long the default PHP charset is UTF-8, however the Windows part is
out of step with this important point. The current implementation in PHP
doesn't technically permit to handle UTF-8 filepath and several other
things. Till now, only the ANSI compatible APIs are being used. Here is more
about it
https://msdn.microsoft.com/en-us/library/windows/desktop/dd317752%28v=vs.85%29.aspx
The patch fixes not only issues with multibyte filenames under
incompatible codepages, but indirectly also issues with some other multibyte
encodings like BIG5, Shift-JIS, etc. by providing a clean way to access
filenames in UTF-8. Below is a small list of issues from the bug tracker,
that are getting fixed:
https://bugs.php.net/63401
https://bugs.php.net/41199
https://bugs.php.net/50203
https://bugs.php.net/71509
https://bugs.php.net/64699
https://bugs.php.net/64506
https://bugs.php.net/30195
https://bugs.php.net/65358
https://bugs.php.net/61315
https://bugs.php.net/70943
https://bugs.php.net/70903
https://bugs.php.net/63593
https://bugs.php.net/54977
https://bugs.php.net/54028
https://bugs.php.net/43148
https://bugs.php.net/30730
https://bugs.php.net/33350
https://bugs.php.net/35300
https://bugs.php.net/46990
https://bugs.php.net/61309
https://bugs.php.net/69333
https://bugs.php.net/45517
https://bugs.php.net/70551
https://bugs.php.net/50197
https://bugs.php.net/72200
https://bugs.php.net/37672
Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow
and Github. Some of the bugs are pretty recent, some descend to early
2000th, but the user comments in there last even till today. Just for example,
bug #30195 was opened in 2004, the latest comment in there was made in 2014. It
is certain, that these bugs descend not only to pure PHP use cases, but get also
redirected from the popular PHP based projects. Given the modern systems (and
those supported by PHP) are always based on NTFS, there is no excuse to keep
these issues unresolved.
The internalization approach on Windows is in many ways different from
UNIX and Linux, while it supports and is based on Unicode. It depends on the
current system code page, APIs used and exact kind how the binary was compiled
The locale doesn't affect the way Unicode or ANSI API work. PHP in particular
is being compiled without _UNICODE defined and this is conditioned by the
way we handle strings. Here is more about it
https://msdn.microsoft.com/en-us/library/tsbaswba.aspx
However, with any system code page ANSI functions automatically convert
paths to UTF-16. Paths in some encodings incompatible with the
current system code page, won't work correctly with ANSI APIs. PHP
till now only uses the ANSI Windows APIs.
For example, on a system with the current code page 1252, the paths
in cp1252 are supported and transparently converted to UTF-16 by the
ANSI functions. Once one wants to handle a filepath encoded with cp932 on
that particular system, an ANSI or a POSIX compatible function used in
PHP will produce an erroneous result. When trying to convert that cp932 path
to UTF-8 and passing to the ANSI functions, an ANSI function would
likely interpret the UTF-8 string as some string in the current code page and
create a filepath that represents every single byte of the UTF-8 string.
These behaviors are not only broken but also disregard the documented
INI settings.
This patch solves the issies with the multibyte paths on Windows by
intelligently enforcing the usage of the Unicode aware APIs. For
functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments
will be converted to UTF-16 wide chars. For functions returning Unicode
aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is
converted back to char's depending on the current PHP charset settings,
either to the current ANSI codepage (this is the behavior prior to this patch)
or to UTF-8 (the default behavior).
In a particular case, users might have to explicitly set
internal_encoding or default_charset, if filenames in ANSI codepage are
necessary. Current tests show no regressions and witness that this will be an
exotic case, the current default UTF-8 encoding is compatible with any
supported system. The dependency libraries are long switching to Unicode APIs,
so some tests were also added for extensions not directly related to streams.
At large, the patch brings over 150 related tests into the core. Those target
and was run on various environments with European, Asian, etc. codepages.
General PHP frameworks was tested and showed no regressions.
The impact on the current C code base is low, the most places affected
are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c
and plain_wrapper.c. The actual implementation of the most of the wide
char supporting functionality is in win32/ioutil.* and win32/codepage.*,
several low level functionsare extended in place to avoid reimplementation for
now. No performance impact was sighted. As previously mentioned, the ANSI APIs
used prior the patch perform Unicode conversions internally. Using the
Unicode APIs directly while doing custom conversions just retains the status
quo. The ways to optimize it are open (fe. by implementing caching for the
strings converted to wide variants).
The long path implementation is user transparent. If a path exceeds the
length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN
is set to 2048 bytes.
Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas
and testing.
Thanks.
2016-06-20 07:32:19 +00:00
|
|
|
/* }}} */
|
2006-06-26 22:41:22 +00:00
|
|
|
/* }}} */
|
|
|
|
|
2017-12-14 15:43:44 +00:00
|
|
|
static const zend_function_entry basic_functions[] = { /* {{{ */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(constant, arginfo_constant)
|
|
|
|
PHP_FE(bin2hex, arginfo_bin2hex)
|
2011-06-03 00:12:22 +00:00
|
|
|
PHP_FE(hex2bin, arginfo_hex2bin)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(sleep, arginfo_sleep)
|
|
|
|
PHP_FE(usleep, arginfo_usleep)
|
2003-11-12 23:43:46 +00:00
|
|
|
#if HAVE_NANOSLEEP
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(time_nanosleep, arginfo_time_nanosleep)
|
|
|
|
PHP_FE(time_sleep_until, arginfo_time_sleep_until)
|
2003-11-12 23:43:46 +00:00
|
|
|
#endif
|
2005-07-03 20:45:08 +00:00
|
|
|
|
2004-09-29 04:57:19 +00:00
|
|
|
#if HAVE_STRPTIME
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(strptime, arginfo_strptime)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PHP_FE(flush, arginfo_flush)
|
|
|
|
PHP_FE(wordwrap, arginfo_wordwrap)
|
|
|
|
PHP_FE(htmlspecialchars, arginfo_htmlspecialchars)
|
|
|
|
PHP_FE(htmlentities, arginfo_htmlentities)
|
|
|
|
PHP_FE(html_entity_decode, arginfo_html_entity_decode)
|
|
|
|
PHP_FE(htmlspecialchars_decode, arginfo_htmlspecialchars_decode)
|
|
|
|
PHP_FE(get_html_translation_table, arginfo_get_html_translation_table)
|
|
|
|
PHP_FE(sha1, arginfo_sha1)
|
|
|
|
PHP_FE(sha1_file, arginfo_sha1_file)
|
|
|
|
PHP_NAMED_FE(md5,php_if_md5, arginfo_md5)
|
|
|
|
PHP_NAMED_FE(md5_file,php_if_md5_file, arginfo_md5_file)
|
|
|
|
PHP_NAMED_FE(crc32,php_if_crc32, arginfo_crc32)
|
|
|
|
|
|
|
|
PHP_FE(iptcparse, arginfo_iptcparse)
|
|
|
|
PHP_FE(iptcembed, arginfo_iptcembed)
|
|
|
|
PHP_FE(getimagesize, arginfo_getimagesize)
|
2010-05-05 13:37:40 +00:00
|
|
|
PHP_FE(getimagesizefromstring, arginfo_getimagesize)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(image_type_to_mime_type, arginfo_image_type_to_mime_type)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(image_type_to_extension, arginfo_image_type_to_extension)
|
2006-06-26 22:41:22 +00:00
|
|
|
|
|
|
|
PHP_FE(phpinfo, arginfo_phpinfo)
|
|
|
|
PHP_FE(phpversion, arginfo_phpversion)
|
|
|
|
PHP_FE(phpcredits, arginfo_phpcredits)
|
|
|
|
PHP_FE(php_sapi_name, arginfo_php_sapi_name)
|
|
|
|
PHP_FE(php_uname, arginfo_php_uname)
|
|
|
|
PHP_FE(php_ini_scanned_files, arginfo_php_ini_scanned_files)
|
2007-06-09 11:44:08 +00:00
|
|
|
PHP_FE(php_ini_loaded_file, arginfo_php_ini_loaded_file)
|
2006-06-26 22:41:22 +00:00
|
|
|
|
|
|
|
PHP_FE(strnatcmp, arginfo_strnatcmp)
|
|
|
|
PHP_FE(strnatcasecmp, arginfo_strnatcasecmp)
|
|
|
|
PHP_FE(substr_count, arginfo_substr_count)
|
|
|
|
PHP_FE(strspn, arginfo_strspn)
|
|
|
|
PHP_FE(strcspn, arginfo_strcspn)
|
|
|
|
PHP_FE(strtok, arginfo_strtok)
|
|
|
|
PHP_FE(strtoupper, arginfo_strtoupper)
|
|
|
|
PHP_FE(strtolower, arginfo_strtolower)
|
|
|
|
PHP_FE(strpos, arginfo_strpos)
|
|
|
|
PHP_FE(stripos, arginfo_stripos)
|
|
|
|
PHP_FE(strrpos, arginfo_strrpos)
|
|
|
|
PHP_FE(strripos, arginfo_strripos)
|
|
|
|
PHP_FE(strrev, arginfo_strrev)
|
|
|
|
PHP_FE(hebrev, arginfo_hebrev)
|
|
|
|
PHP_FE(hebrevc, arginfo_hebrevc)
|
|
|
|
PHP_FE(nl2br, arginfo_nl2br)
|
|
|
|
PHP_FE(basename, arginfo_basename)
|
|
|
|
PHP_FE(dirname, arginfo_dirname)
|
|
|
|
PHP_FE(pathinfo, arginfo_pathinfo)
|
|
|
|
PHP_FE(stripslashes, arginfo_stripslashes)
|
|
|
|
PHP_FE(stripcslashes, arginfo_stripcslashes)
|
|
|
|
PHP_FE(strstr, arginfo_strstr)
|
|
|
|
PHP_FE(stristr, arginfo_stristr)
|
|
|
|
PHP_FE(strrchr, arginfo_strrchr)
|
|
|
|
PHP_FE(str_shuffle, arginfo_str_shuffle)
|
|
|
|
PHP_FE(str_word_count, arginfo_str_word_count)
|
|
|
|
PHP_FE(str_split, arginfo_str_split)
|
|
|
|
PHP_FE(strpbrk, arginfo_strpbrk)
|
|
|
|
PHP_FE(substr_compare, arginfo_substr_compare)
|
2016-10-13 22:33:33 +00:00
|
|
|
PHP_FE(utf8_encode, arginfo_utf8_encode)
|
|
|
|
PHP_FE(utf8_decode, arginfo_utf8_decode)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-01-17 01:10:50 +00:00
|
|
|
#ifdef HAVE_STRCOLL
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(strcoll, arginfo_strcoll)
|
2001-01-17 01:10:50 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2002-08-02 10:08:53 +00:00
|
|
|
#ifdef HAVE_STRFMON
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(money_format, arginfo_money_format)
|
2006-06-26 22:41:22 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
PHP_FE(substr, arginfo_substr)
|
|
|
|
PHP_FE(substr_replace, arginfo_substr_replace)
|
|
|
|
PHP_FE(quotemeta, arginfo_quotemeta)
|
|
|
|
PHP_FE(ucfirst, arginfo_ucfirst)
|
2008-01-19 19:27:22 +00:00
|
|
|
PHP_FE(lcfirst, arginfo_lcfirst)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(ucwords, arginfo_ucwords)
|
|
|
|
PHP_FE(strtr, arginfo_strtr)
|
|
|
|
PHP_FE(addslashes, arginfo_addslashes)
|
|
|
|
PHP_FE(addcslashes, arginfo_addcslashes)
|
|
|
|
PHP_FE(rtrim, arginfo_rtrim)
|
|
|
|
PHP_FE(str_replace, arginfo_str_replace)
|
|
|
|
PHP_FE(str_ireplace, arginfo_str_ireplace)
|
|
|
|
PHP_FE(str_repeat, arginfo_str_repeat)
|
|
|
|
PHP_FE(count_chars, arginfo_count_chars)
|
|
|
|
PHP_FE(chunk_split, arginfo_chunk_split)
|
|
|
|
PHP_FE(trim, arginfo_trim)
|
|
|
|
PHP_FE(ltrim, arginfo_ltrim)
|
|
|
|
PHP_FE(strip_tags, arginfo_strip_tags)
|
|
|
|
PHP_FE(similar_text, arginfo_similar_text)
|
|
|
|
PHP_FE(explode, arginfo_explode)
|
|
|
|
PHP_FE(implode, arginfo_implode)
|
2007-10-05 15:00:09 +00:00
|
|
|
PHP_FALIAS(join, implode, arginfo_implode)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(setlocale, arginfo_setlocale)
|
|
|
|
PHP_FE(localeconv, arginfo_localeconv)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-07-04 10:10:30 +00:00
|
|
|
#if HAVE_NL_LANGINFO
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(nl_langinfo, arginfo_nl_langinfo)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PHP_FE(soundex, arginfo_soundex)
|
|
|
|
PHP_FE(levenshtein, arginfo_levenshtein)
|
|
|
|
PHP_FE(chr, arginfo_chr)
|
|
|
|
PHP_FE(ord, arginfo_ord)
|
|
|
|
PHP_FE(parse_str, arginfo_parse_str)
|
2008-11-02 18:24:34 +00:00
|
|
|
PHP_FE(str_getcsv, arginfo_str_getcsv)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(str_pad, arginfo_str_pad)
|
|
|
|
PHP_FALIAS(chop, rtrim, arginfo_rtrim)
|
|
|
|
PHP_FALIAS(strchr, strstr, arginfo_strstr)
|
|
|
|
PHP_NAMED_FE(sprintf, PHP_FN(user_sprintf), arginfo_sprintf)
|
|
|
|
PHP_NAMED_FE(printf, PHP_FN(user_printf), arginfo_printf)
|
|
|
|
PHP_FE(vprintf, arginfo_vprintf)
|
|
|
|
PHP_FE(vsprintf, arginfo_vsprintf)
|
|
|
|
PHP_FE(fprintf, arginfo_fprintf)
|
|
|
|
PHP_FE(vfprintf, arginfo_vfprintf)
|
|
|
|
PHP_FE(sscanf, arginfo_sscanf)
|
|
|
|
PHP_FE(fscanf, arginfo_fscanf)
|
|
|
|
PHP_FE(parse_url, arginfo_parse_url)
|
|
|
|
PHP_FE(urlencode, arginfo_urlencode)
|
|
|
|
PHP_FE(urldecode, arginfo_urldecode)
|
|
|
|
PHP_FE(rawurlencode, arginfo_rawurlencode)
|
|
|
|
PHP_FE(rawurldecode, arginfo_rawurldecode)
|
|
|
|
PHP_FE(http_build_query, arginfo_http_build_query)
|
1999-07-28 13:59:35 +00:00
|
|
|
|
2009-01-16 01:01:04 +00:00
|
|
|
#if defined(HAVE_SYMLINK) || defined(PHP_WIN32)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(readlink, arginfo_readlink)
|
|
|
|
PHP_FE(linkinfo, arginfo_linkinfo)
|
|
|
|
PHP_FE(symlink, arginfo_symlink)
|
|
|
|
PHP_FE(link, arginfo_link)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PHP_FE(unlink, arginfo_unlink)
|
|
|
|
PHP_FE(exec, arginfo_exec)
|
|
|
|
PHP_FE(system, arginfo_system)
|
|
|
|
PHP_FE(escapeshellcmd, arginfo_escapeshellcmd)
|
|
|
|
PHP_FE(escapeshellarg, arginfo_escapeshellarg)
|
|
|
|
PHP_FE(passthru, arginfo_passthru)
|
|
|
|
PHP_FE(shell_exec, arginfo_shell_exec)
|
2003-01-15 16:29:00 +00:00
|
|
|
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(proc_open, arginfo_proc_open)
|
|
|
|
PHP_FE(proc_close, arginfo_proc_close)
|
|
|
|
PHP_FE(proc_terminate, arginfo_proc_terminate)
|
|
|
|
PHP_FE(proc_get_status, arginfo_proc_get_status)
|
2003-01-15 16:29:00 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2003-02-18 01:07:57 +00:00
|
|
|
#ifdef HAVE_NICE
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(proc_nice, arginfo_proc_nice)
|
2003-02-18 01:07:57 +00:00
|
|
|
#endif
|
|
|
|
|
2016-08-10 22:32:32 +00:00
|
|
|
PHP_FE(rand, arginfo_mt_rand)
|
2016-07-05 14:09:49 +00:00
|
|
|
PHP_FALIAS(srand, mt_srand, arginfo_mt_srand)
|
|
|
|
PHP_FALIAS(getrandmax, mt_getrandmax, arginfo_mt_getrandmax)
|
|
|
|
PHP_FE(mt_rand, arginfo_mt_rand)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(mt_srand, arginfo_mt_srand)
|
2010-10-04 20:33:58 +00:00
|
|
|
PHP_FE(mt_getrandmax, arginfo_mt_getrandmax)
|
2001-05-19 22:21:40 +00:00
|
|
|
|
2015-02-13 02:53:55 +00:00
|
|
|
PHP_FE(random_bytes, arginfo_random_bytes)
|
|
|
|
PHP_FE(random_int, arginfo_random_int)
|
|
|
|
|
2001-05-19 22:21:40 +00:00
|
|
|
#if HAVE_GETSERVBYNAME
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getservbyname, arginfo_getservbyname)
|
2001-05-19 22:21:40 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-01-21 17:29:15 +00:00
|
|
|
#if HAVE_GETSERVBYPORT
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getservbyport, arginfo_getservbyport)
|
2001-01-21 17:29:15 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-01-21 17:29:15 +00:00
|
|
|
#if HAVE_GETPROTOBYNAME
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getprotobyname, arginfo_getprotobyname)
|
2001-01-21 17:29:15 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-01-21 17:29:15 +00:00
|
|
|
#if HAVE_GETPROTOBYNUMBER
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getprotobynumber, arginfo_getprotobynumber)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PHP_FE(getmyuid, arginfo_getmyuid)
|
|
|
|
PHP_FE(getmygid, arginfo_getmygid)
|
|
|
|
PHP_FE(getmypid, arginfo_getmypid)
|
|
|
|
PHP_FE(getmyinode, arginfo_getmyinode)
|
|
|
|
PHP_FE(getlastmod, arginfo_getlastmod)
|
|
|
|
|
|
|
|
PHP_FE(base64_decode, arginfo_base64_decode)
|
|
|
|
PHP_FE(base64_encode, arginfo_base64_encode)
|
|
|
|
|
2012-06-26 01:22:16 +00:00
|
|
|
PHP_FE(password_hash, arginfo_password_hash)
|
2012-07-05 21:46:33 +00:00
|
|
|
PHP_FE(password_get_info, arginfo_password_get_info)
|
2012-07-05 20:22:49 +00:00
|
|
|
PHP_FE(password_needs_rehash, arginfo_password_needs_rehash)
|
2012-06-25 02:44:43 +00:00
|
|
|
PHP_FE(password_verify, arginfo_password_verify)
|
2018-10-15 18:58:34 +00:00
|
|
|
PHP_FE(password_algos, arginfo_password_algos)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(convert_uuencode, arginfo_convert_uuencode)
|
|
|
|
PHP_FE(convert_uudecode, arginfo_convert_uudecode)
|
|
|
|
|
|
|
|
PHP_FE(abs, arginfo_abs)
|
|
|
|
PHP_FE(ceil, arginfo_ceil)
|
|
|
|
PHP_FE(floor, arginfo_floor)
|
|
|
|
PHP_FE(round, arginfo_round)
|
|
|
|
PHP_FE(sin, arginfo_sin)
|
|
|
|
PHP_FE(cos, arginfo_cos)
|
|
|
|
PHP_FE(tan, arginfo_tan)
|
|
|
|
PHP_FE(asin, arginfo_asin)
|
|
|
|
PHP_FE(acos, arginfo_acos)
|
|
|
|
PHP_FE(atan, arginfo_atan)
|
2008-05-05 11:28:11 +00:00
|
|
|
PHP_FE(atanh, arginfo_atanh)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(atan2, arginfo_atan2)
|
|
|
|
PHP_FE(sinh, arginfo_sinh)
|
|
|
|
PHP_FE(cosh, arginfo_cosh)
|
|
|
|
PHP_FE(tanh, arginfo_tanh)
|
|
|
|
PHP_FE(asinh, arginfo_asinh)
|
|
|
|
PHP_FE(acosh, arginfo_acosh)
|
|
|
|
PHP_FE(expm1, arginfo_expm1)
|
|
|
|
PHP_FE(log1p, arginfo_log1p)
|
|
|
|
PHP_FE(pi, arginfo_pi)
|
|
|
|
PHP_FE(is_finite, arginfo_is_finite)
|
|
|
|
PHP_FE(is_nan, arginfo_is_nan)
|
|
|
|
PHP_FE(is_infinite, arginfo_is_infinite)
|
|
|
|
PHP_FE(pow, arginfo_pow)
|
|
|
|
PHP_FE(exp, arginfo_exp)
|
|
|
|
PHP_FE(log, arginfo_log)
|
|
|
|
PHP_FE(log10, arginfo_log10)
|
|
|
|
PHP_FE(sqrt, arginfo_sqrt)
|
|
|
|
PHP_FE(hypot, arginfo_hypot)
|
|
|
|
PHP_FE(deg2rad, arginfo_deg2rad)
|
|
|
|
PHP_FE(rad2deg, arginfo_rad2deg)
|
|
|
|
PHP_FE(bindec, arginfo_bindec)
|
|
|
|
PHP_FE(hexdec, arginfo_hexdec)
|
|
|
|
PHP_FE(octdec, arginfo_octdec)
|
|
|
|
PHP_FE(decbin, arginfo_decbin)
|
|
|
|
PHP_FE(decoct, arginfo_decoct)
|
|
|
|
PHP_FE(dechex, arginfo_dechex)
|
|
|
|
PHP_FE(base_convert, arginfo_base_convert)
|
|
|
|
PHP_FE(number_format, arginfo_number_format)
|
|
|
|
PHP_FE(fmod, arginfo_fmod)
|
2014-07-14 23:35:26 +00:00
|
|
|
PHP_FE(intdiv, arginfo_intdiv)
|
2004-08-07 04:50:24 +00:00
|
|
|
#ifdef HAVE_INET_NTOP
|
2017-11-21 15:04:37 +00:00
|
|
|
PHP_RAW_NAMED_FE(inet_ntop, zif_inet_ntop, arginfo_inet_ntop)
|
2004-08-07 04:50:24 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_INET_PTON
|
2006-12-20 10:34:36 +00:00
|
|
|
PHP_RAW_NAMED_FE(inet_pton, php_inet_pton, arginfo_inet_pton)
|
2004-08-07 04:50:24 +00:00
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(ip2long, arginfo_ip2long)
|
|
|
|
PHP_FE(long2ip, arginfo_long2ip)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getenv, arginfo_getenv)
|
2000-05-27 19:27:20 +00:00
|
|
|
#ifdef HAVE_PUTENV
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(putenv, arginfo_putenv)
|
2000-05-27 19:27:20 +00:00
|
|
|
#endif
|
1999-07-24 22:16:54 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getopt, arginfo_getopt)
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2006-02-16 22:49:13 +00:00
|
|
|
#ifdef HAVE_GETLOADAVG
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(sys_getloadavg, arginfo_sys_getloadavg)
|
2006-02-16 22:49:13 +00:00
|
|
|
#endif
|
2002-10-29 23:35:49 +00:00
|
|
|
#ifdef HAVE_GETTIMEOFDAY
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(microtime, arginfo_microtime)
|
|
|
|
PHP_FE(gettimeofday, arginfo_gettimeofday)
|
2002-10-29 23:35:49 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2000-05-27 19:27:20 +00:00
|
|
|
#ifdef HAVE_GETRUSAGE
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getrusage, arginfo_getrusage)
|
2000-05-27 19:27:20 +00:00
|
|
|
#endif
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2018-01-07 14:55:12 +00:00
|
|
|
PHP_FE(hrtime, arginfo_hrtime)
|
|
|
|
|
2002-12-20 16:34:42 +00:00
|
|
|
#ifdef HAVE_GETTIMEOFDAY
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(uniqid, arginfo_uniqid)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
PHP_FE(quoted_printable_decode, arginfo_quoted_printable_decode)
|
2008-08-14 10:12:21 +00:00
|
|
|
PHP_FE(quoted_printable_encode, arginfo_quoted_printable_encode)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(convert_cyr_string, arginfo_convert_cyr_string)
|
|
|
|
PHP_FE(get_current_user, arginfo_get_current_user)
|
|
|
|
PHP_FE(set_time_limit, arginfo_set_time_limit)
|
2011-02-03 16:47:28 +00:00
|
|
|
PHP_FE(header_register_callback, arginfo_header_register_callback)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(get_cfg_var, arginfo_get_cfg_var)
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2011-11-15 13:22:52 +00:00
|
|
|
PHP_FE(get_magic_quotes_gpc, arginfo_get_magic_quotes_gpc)
|
|
|
|
PHP_FE(get_magic_quotes_runtime, arginfo_get_magic_quotes_runtime)
|
2007-09-28 02:05:10 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(error_log, arginfo_error_log)
|
2006-07-19 12:25:46 +00:00
|
|
|
PHP_FE(error_get_last, arginfo_error_get_last)
|
2015-03-03 09:48:03 +00:00
|
|
|
PHP_FE(error_clear_last, arginfo_error_clear_last)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(call_user_func, arginfo_call_user_func)
|
|
|
|
PHP_FE(call_user_func_array, arginfo_call_user_func_array)
|
2008-04-07 10:44:59 +00:00
|
|
|
PHP_FE(forward_static_call, arginfo_forward_static_call)
|
|
|
|
PHP_FE(forward_static_call_array, arginfo_forward_static_call_array)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(serialize, arginfo_serialize)
|
|
|
|
PHP_FE(unserialize, arginfo_unserialize)
|
|
|
|
|
|
|
|
PHP_FE(var_dump, arginfo_var_dump)
|
|
|
|
PHP_FE(var_export, arginfo_var_export)
|
|
|
|
PHP_FE(debug_zval_dump, arginfo_debug_zval_dump)
|
|
|
|
PHP_FE(print_r, arginfo_print_r)
|
|
|
|
PHP_FE(memory_get_usage, arginfo_memory_get_usage)
|
|
|
|
PHP_FE(memory_get_peak_usage, arginfo_memory_get_peak_usage)
|
|
|
|
|
|
|
|
PHP_FE(register_shutdown_function, arginfo_register_shutdown_function)
|
|
|
|
PHP_FE(register_tick_function, arginfo_register_tick_function)
|
|
|
|
PHP_FE(unregister_tick_function, arginfo_unregister_tick_function)
|
|
|
|
|
|
|
|
PHP_FE(highlight_file, arginfo_highlight_file)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FALIAS(show_source, highlight_file, arginfo_highlight_file)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(highlight_string, arginfo_highlight_string)
|
|
|
|
PHP_FE(php_strip_whitespace, arginfo_php_strip_whitespace)
|
|
|
|
|
|
|
|
PHP_FE(ini_get, arginfo_ini_get)
|
|
|
|
PHP_FE(ini_get_all, arginfo_ini_get_all)
|
|
|
|
PHP_FE(ini_set, arginfo_ini_set)
|
|
|
|
PHP_FALIAS(ini_alter, ini_set, arginfo_ini_set)
|
|
|
|
PHP_FE(ini_restore, arginfo_ini_restore)
|
|
|
|
PHP_FE(get_include_path, arginfo_get_include_path)
|
|
|
|
PHP_FE(set_include_path, arginfo_set_include_path)
|
|
|
|
PHP_FE(restore_include_path, arginfo_restore_include_path)
|
|
|
|
|
|
|
|
PHP_FE(setcookie, arginfo_setcookie)
|
|
|
|
PHP_FE(setrawcookie, arginfo_setrawcookie)
|
|
|
|
PHP_FE(header, arginfo_header)
|
Added header_remove() (chsc at peytz dotdk, Arnaud)
[DOC] proto void header_remove([string header_name])
Removes an HTTP header previously set using header()
The header_name parameter is optionnal, all headers are
removed if it is not set
[SAPIs] The header_handler callback in sapi_module_struct has
been changed, it now take a new argument.
When it is set to SAPI_HEADER_DELETE, sapi_header->header is
the name of an header, header_handler has to delete it.
When it is set to SAPI_HEADER_DELETE_ALL, header_handler has
to delete all headers.
When sapi_header_op_enum is SAPI_HEADER_ADD or _REPLACE,
sapi_header->header is in the form "Name: value", header_handler
has to add or replace the given header.
In all cases, header_handler must not free sapi_header or
sapi_header->header. SAPI_HEADER_ADD must be returned if the
header has been added or replaced, or 0 in other cases.
2008-11-13 10:14:04 +00:00
|
|
|
PHP_FE(header_remove, arginfo_header_remove)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(headers_sent, arginfo_headers_sent)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(headers_list, arginfo_headers_list)
|
2010-08-09 13:10:32 +00:00
|
|
|
PHP_FE(http_response_code, arginfo_http_response_code)
|
2006-06-26 22:41:22 +00:00
|
|
|
|
|
|
|
PHP_FE(connection_aborted, arginfo_connection_aborted)
|
|
|
|
PHP_FE(connection_status, arginfo_connection_status)
|
|
|
|
PHP_FE(ignore_user_abort, arginfo_ignore_user_abort)
|
|
|
|
PHP_FE(parse_ini_file, arginfo_parse_ini_file)
|
2008-11-05 21:35:02 +00:00
|
|
|
PHP_FE(parse_ini_string, arginfo_parse_ini_string)
|
2008-04-15 09:02:40 +00:00
|
|
|
#if ZEND_DEBUG
|
|
|
|
PHP_FE(config_get_hash, arginfo_config_get_hash)
|
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(is_uploaded_file, arginfo_is_uploaded_file)
|
|
|
|
PHP_FE(move_uploaded_file, arginfo_move_uploaded_file)
|
2000-09-08 21:56:47 +00:00
|
|
|
|
2002-11-19 02:34:13 +00:00
|
|
|
/* functions from dns.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(gethostbyaddr, arginfo_gethostbyaddr)
|
|
|
|
PHP_FE(gethostbyname, arginfo_gethostbyname)
|
|
|
|
PHP_FE(gethostbynamel, arginfo_gethostbynamel)
|
2002-11-19 02:34:13 +00:00
|
|
|
|
2008-12-31 14:30:38 +00:00
|
|
|
#ifdef HAVE_GETHOSTNAME
|
|
|
|
PHP_FE(gethostname, arginfo_gethostname)
|
|
|
|
#endif
|
|
|
|
|
2017-11-21 15:04:37 +00:00
|
|
|
#if defined(PHP_WIN32) || HAVE_GETIFADDRS
|
|
|
|
PHP_FE(net_get_interfaces, arginfo_net_get_interfaces)
|
|
|
|
#endif
|
|
|
|
|
2017-08-29 20:03:56 +00:00
|
|
|
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
|
2009-01-06 20:48:21 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(dns_check_record, arginfo_dns_check_record)
|
|
|
|
PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
|
2009-01-06 20:48:21 +00:00
|
|
|
|
2009-08-11 22:07:35 +00:00
|
|
|
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(dns_get_mx, arginfo_dns_get_mx)
|
2009-01-06 20:48:21 +00:00
|
|
|
PHP_FALIAS(getmxrr, dns_get_mx, arginfo_dns_get_mx)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(dns_get_record, arginfo_dns_get_record)
|
2002-11-19 02:34:13 +00:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2002-01-09 23:47:46 +00:00
|
|
|
/* functions from type.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(intval, arginfo_intval)
|
|
|
|
PHP_FE(floatval, arginfo_floatval)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FALIAS(doubleval, floatval, arginfo_floatval)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(strval, arginfo_strval)
|
2012-06-06 20:34:51 +00:00
|
|
|
PHP_FE(boolval, arginfo_boolval)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(gettype, arginfo_gettype)
|
|
|
|
PHP_FE(settype, arginfo_settype)
|
|
|
|
PHP_FE(is_null, arginfo_is_null)
|
|
|
|
PHP_FE(is_resource, arginfo_is_resource)
|
|
|
|
PHP_FE(is_bool, arginfo_is_bool)
|
2014-12-14 21:26:16 +00:00
|
|
|
PHP_FE(is_int, arginfo_is_int)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(is_float, arginfo_is_float)
|
2014-12-14 21:26:16 +00:00
|
|
|
PHP_FALIAS(is_integer, is_int, arginfo_is_int)
|
|
|
|
PHP_FALIAS(is_long, is_int, arginfo_is_int)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FALIAS(is_double, is_float, arginfo_is_float)
|
|
|
|
PHP_FALIAS(is_real, is_float, arginfo_is_float)
|
|
|
|
PHP_FE(is_numeric, arginfo_is_numeric)
|
|
|
|
PHP_FE(is_string, arginfo_is_string)
|
|
|
|
PHP_FE(is_array, arginfo_is_array)
|
|
|
|
PHP_FE(is_object, arginfo_is_object)
|
|
|
|
PHP_FE(is_scalar, arginfo_is_scalar)
|
|
|
|
PHP_FE(is_callable, arginfo_is_callable)
|
2016-06-03 22:42:12 +00:00
|
|
|
PHP_FE(is_iterable, arginfo_is_iterable)
|
2018-01-19 22:01:40 +00:00
|
|
|
PHP_FE(is_countable, arginfo_is_countable)
|
2002-01-09 23:47:46 +00:00
|
|
|
|
2000-03-06 20:37:11 +00:00
|
|
|
/* functions from file.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(pclose, arginfo_pclose)
|
|
|
|
PHP_FE(popen, arginfo_popen)
|
|
|
|
PHP_FE(readfile, arginfo_readfile)
|
|
|
|
PHP_FE(rewind, arginfo_rewind)
|
|
|
|
PHP_FE(rmdir, arginfo_rmdir)
|
|
|
|
PHP_FE(umask, arginfo_umask)
|
|
|
|
PHP_FE(fclose, arginfo_fclose)
|
|
|
|
PHP_FE(feof, arginfo_feof)
|
|
|
|
PHP_FE(fgetc, arginfo_fgetc)
|
|
|
|
PHP_FE(fgets, arginfo_fgets)
|
2018-07-05 16:43:42 +00:00
|
|
|
PHP_DEP_FE(fgetss, arginfo_fgetss)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(fread, arginfo_fread)
|
|
|
|
PHP_NAMED_FE(fopen, php_if_fopen, arginfo_fopen)
|
|
|
|
PHP_FE(fpassthru, arginfo_fpassthru)
|
|
|
|
PHP_NAMED_FE(ftruncate, php_if_ftruncate, arginfo_ftruncate)
|
|
|
|
PHP_NAMED_FE(fstat, php_if_fstat, arginfo_fstat)
|
|
|
|
PHP_FE(fseek, arginfo_fseek)
|
|
|
|
PHP_FE(ftell, arginfo_ftell)
|
|
|
|
PHP_FE(fflush, arginfo_fflush)
|
|
|
|
PHP_FE(fwrite, arginfo_fwrite)
|
|
|
|
PHP_FALIAS(fputs, fwrite, arginfo_fwrite)
|
|
|
|
PHP_FE(mkdir, arginfo_mkdir)
|
|
|
|
PHP_FE(rename, arginfo_rename)
|
|
|
|
PHP_FE(copy, arginfo_copy)
|
|
|
|
PHP_FE(tempnam, arginfo_tempnam)
|
|
|
|
PHP_NAMED_FE(tmpfile, php_if_tmpfile, arginfo_tmpfile)
|
|
|
|
PHP_FE(file, arginfo_file)
|
|
|
|
PHP_FE(file_get_contents, arginfo_file_get_contents)
|
|
|
|
PHP_FE(file_put_contents, arginfo_file_put_contents)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(stream_select, arginfo_stream_select)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_context_create, arginfo_stream_context_create)
|
|
|
|
PHP_FE(stream_context_set_params, arginfo_stream_context_set_params)
|
2008-11-13 05:47:47 +00:00
|
|
|
PHP_FE(stream_context_get_params, arginfo_stream_context_get_params)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_context_set_option, arginfo_stream_context_set_option)
|
|
|
|
PHP_FE(stream_context_get_options, arginfo_stream_context_get_options)
|
|
|
|
PHP_FE(stream_context_get_default, arginfo_stream_context_get_default)
|
2008-08-16 10:57:56 +00:00
|
|
|
PHP_FE(stream_context_set_default, arginfo_stream_context_set_default)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_filter_prepend, arginfo_stream_filter_prepend)
|
|
|
|
PHP_FE(stream_filter_append, arginfo_stream_filter_append)
|
|
|
|
PHP_FE(stream_filter_remove, arginfo_stream_filter_remove)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(stream_socket_client, arginfo_stream_socket_client)
|
|
|
|
PHP_FE(stream_socket_server, arginfo_stream_socket_server)
|
|
|
|
PHP_FE(stream_socket_accept, arginfo_stream_socket_accept)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_socket_get_name, arginfo_stream_socket_get_name)
|
|
|
|
PHP_FE(stream_socket_recvfrom, arginfo_stream_socket_recvfrom)
|
|
|
|
PHP_FE(stream_socket_sendto, arginfo_stream_socket_sendto)
|
|
|
|
PHP_FE(stream_socket_enable_crypto, arginfo_stream_socket_enable_crypto)
|
2006-12-19 08:58:58 +00:00
|
|
|
#ifdef HAVE_SHUTDOWN
|
|
|
|
PHP_FE(stream_socket_shutdown, arginfo_stream_socket_shutdown)
|
|
|
|
#endif
|
2004-12-12 16:10:35 +00:00
|
|
|
#if HAVE_SOCKETPAIR
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_socket_pair, arginfo_stream_socket_pair)
|
|
|
|
#endif
|
|
|
|
PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream)
|
|
|
|
PHP_FE(stream_get_contents, arginfo_stream_get_contents)
|
2007-11-20 22:17:01 +00:00
|
|
|
PHP_FE(stream_supports_lock, arginfo_stream_supports_lock)
|
2016-08-29 09:57:53 +00:00
|
|
|
PHP_FE(stream_isatty, arginfo_stream_isatty)
|
|
|
|
#ifdef PHP_WIN32
|
|
|
|
PHP_FE(sapi_windows_vt100_support, arginfo_sapi_windows_vt100_support)
|
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(fgetcsv, arginfo_fgetcsv)
|
|
|
|
PHP_FE(fputcsv, arginfo_fputcsv)
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(flock, arginfo_flock)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(get_meta_tags, arginfo_get_meta_tags)
|
2010-04-12 08:25:50 +00:00
|
|
|
PHP_FE(stream_set_read_buffer, arginfo_stream_set_read_buffer)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_set_write_buffer, arginfo_stream_set_write_buffer)
|
|
|
|
PHP_FALIAS(set_file_buffer, stream_set_write_buffer, arginfo_stream_set_write_buffer)
|
2011-02-19 01:28:37 +00:00
|
|
|
PHP_FE(stream_set_chunk_size, arginfo_stream_set_chunk_size)
|
2006-06-26 22:41:22 +00:00
|
|
|
|
|
|
|
PHP_FE(stream_set_blocking, arginfo_stream_set_blocking)
|
|
|
|
PHP_FALIAS(socket_set_blocking, stream_set_blocking, arginfo_stream_set_blocking)
|
|
|
|
|
|
|
|
PHP_FE(stream_get_meta_data, arginfo_stream_get_meta_data)
|
|
|
|
PHP_FE(stream_get_line, arginfo_stream_get_line)
|
|
|
|
PHP_FE(stream_wrapper_register, arginfo_stream_wrapper_register)
|
|
|
|
PHP_FALIAS(stream_register_wrapper, stream_wrapper_register, arginfo_stream_wrapper_register)
|
|
|
|
PHP_FE(stream_wrapper_unregister, arginfo_stream_wrapper_unregister)
|
|
|
|
PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore)
|
|
|
|
PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers)
|
|
|
|
PHP_FE(stream_get_transports, arginfo_stream_get_transports)
|
2009-12-24 13:12:03 +00:00
|
|
|
PHP_FE(stream_resolve_include_path, arginfo_stream_resolve_include_path)
|
2007-07-09 17:27:24 +00:00
|
|
|
PHP_FE(stream_is_local, arginfo_stream_is_local)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(get_headers, arginfo_get_headers)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2002-07-10 15:23:47 +00:00
|
|
|
#if HAVE_SYS_TIME_H || defined(PHP_WIN32)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_set_timeout, arginfo_stream_set_timeout)
|
|
|
|
PHP_FALIAS(socket_set_timeout, stream_set_timeout, arginfo_stream_set_timeout)
|
2000-05-27 19:27:20 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2017-08-29 20:03:56 +00:00
|
|
|
#if HAVE_REALPATH || defined(ZTS)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(realpath, arginfo_realpath)
|
2000-08-19 18:01:04 +00:00
|
|
|
#endif
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2002-03-21 19:18:13 +00:00
|
|
|
#ifdef HAVE_FNMATCH
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(fnmatch, arginfo_fnmatch)
|
2002-03-21 19:18:13 +00:00
|
|
|
#endif
|
|
|
|
|
2000-03-06 20:37:11 +00:00
|
|
|
/* functions from fsock.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(fsockopen, arginfo_fsockopen)
|
|
|
|
PHP_FE(pfsockopen, arginfo_pfsockopen)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from pack.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(pack, arginfo_pack)
|
|
|
|
PHP_FE(unpack, arginfo_unpack)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from browscap.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(get_browser, arginfo_get_browser)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from crypt.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(crypt, arginfo_crypt)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from dir.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(opendir, arginfo_opendir)
|
|
|
|
PHP_FE(closedir, arginfo_closedir)
|
|
|
|
PHP_FE(chdir, arginfo_chdir)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-09-12 02:07:46 +00:00
|
|
|
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(chroot, arginfo_chroot)
|
2001-02-15 00:43:44 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(getcwd, arginfo_getcwd)
|
|
|
|
PHP_FE(rewinddir, arginfo_rewinddir)
|
|
|
|
PHP_NAMED_FE(readdir, php_if_readdir, arginfo_readdir)
|
|
|
|
PHP_FALIAS(dir, getdir, arginfo_dir)
|
|
|
|
PHP_FE(scandir, arginfo_scandir)
|
2002-03-21 19:18:13 +00:00
|
|
|
#ifdef HAVE_GLOB
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(glob, arginfo_glob)
|
2002-03-21 19:18:13 +00:00
|
|
|
#endif
|
2000-03-06 20:37:11 +00:00
|
|
|
/* functions from filestat.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(fileatime, arginfo_fileatime)
|
|
|
|
PHP_FE(filectime, arginfo_filectime)
|
|
|
|
PHP_FE(filegroup, arginfo_filegroup)
|
|
|
|
PHP_FE(fileinode, arginfo_fileinode)
|
|
|
|
PHP_FE(filemtime, arginfo_filemtime)
|
|
|
|
PHP_FE(fileowner, arginfo_fileowner)
|
|
|
|
PHP_FE(fileperms, arginfo_fileperms)
|
|
|
|
PHP_FE(filesize, arginfo_filesize)
|
|
|
|
PHP_FE(filetype, arginfo_filetype)
|
|
|
|
PHP_FE(file_exists, arginfo_file_exists)
|
|
|
|
PHP_FE(is_writable, arginfo_is_writable)
|
|
|
|
PHP_FALIAS(is_writeable, is_writable, arginfo_is_writable)
|
|
|
|
PHP_FE(is_readable, arginfo_is_readable)
|
|
|
|
PHP_FE(is_executable, arginfo_is_executable)
|
|
|
|
PHP_FE(is_file, arginfo_is_file)
|
|
|
|
PHP_FE(is_dir, arginfo_is_dir)
|
|
|
|
PHP_FE(is_link, arginfo_is_link)
|
|
|
|
PHP_NAMED_FE(stat, php_if_stat, arginfo_stat)
|
|
|
|
PHP_NAMED_FE(lstat, php_if_lstat, arginfo_lstat)
|
|
|
|
PHP_FE(chown, arginfo_chown)
|
|
|
|
PHP_FE(chgrp, arginfo_chgrp)
|
2006-01-04 21:31:35 +00:00
|
|
|
#if HAVE_LCHOWN
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(lchown, arginfo_lchown)
|
2007-10-01 12:40:54 +00:00
|
|
|
#endif
|
|
|
|
#if HAVE_LCHOWN
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(lchgrp, arginfo_lchgrp)
|
2004-09-25 13:19:45 +00:00
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(chmod, arginfo_chmod)
|
2002-04-26 23:46:51 +00:00
|
|
|
#if HAVE_UTIME
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(touch, arginfo_touch)
|
2007-10-01 12:40:54 +00:00
|
|
|
#endif
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(clearstatcache, arginfo_clearstatcache)
|
|
|
|
PHP_FE(disk_total_space, arginfo_disk_total_space)
|
|
|
|
PHP_FE(disk_free_space, arginfo_disk_free_space)
|
|
|
|
PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space)
|
2009-12-08 01:35:08 +00:00
|
|
|
PHP_FE(realpath_cache_size, arginfo_realpath_cache_size)
|
|
|
|
PHP_FE(realpath_cache_get, arginfo_realpath_cache_get)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from mail.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(mail, arginfo_mail)
|
|
|
|
PHP_FE(ezmlm_hash, arginfo_ezmlm_hash)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from syslog.c */
|
2001-02-24 21:08:15 +00:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(openlog, arginfo_openlog)
|
|
|
|
PHP_FE(syslog, arginfo_syslog)
|
|
|
|
PHP_FE(closelog, arginfo_closelog)
|
2001-02-24 21:08:15 +00:00
|
|
|
#endif
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from lcg.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(lcg_value, arginfo_lcg_value)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from metaphone.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(metaphone, arginfo_metaphone)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from output.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(ob_start, arginfo_ob_start)
|
|
|
|
PHP_FE(ob_flush, arginfo_ob_flush)
|
|
|
|
PHP_FE(ob_clean, arginfo_ob_clean)
|
|
|
|
PHP_FE(ob_end_flush, arginfo_ob_end_flush)
|
|
|
|
PHP_FE(ob_end_clean, arginfo_ob_end_clean)
|
|
|
|
PHP_FE(ob_get_flush, arginfo_ob_get_flush)
|
|
|
|
PHP_FE(ob_get_clean, arginfo_ob_get_clean)
|
|
|
|
PHP_FE(ob_get_length, arginfo_ob_get_length)
|
|
|
|
PHP_FE(ob_get_level, arginfo_ob_get_level)
|
|
|
|
PHP_FE(ob_get_status, arginfo_ob_get_status)
|
|
|
|
PHP_FE(ob_get_contents, arginfo_ob_get_contents)
|
|
|
|
PHP_FE(ob_implicit_flush, arginfo_ob_implicit_flush)
|
|
|
|
PHP_FE(ob_list_handlers, arginfo_ob_list_handlers)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
|
|
|
/* functions from array.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(ksort, arginfo_ksort)
|
|
|
|
PHP_FE(krsort, arginfo_krsort)
|
|
|
|
PHP_FE(natsort, arginfo_natsort)
|
|
|
|
PHP_FE(natcasesort, arginfo_natcasesort)
|
|
|
|
PHP_FE(asort, arginfo_asort)
|
|
|
|
PHP_FE(arsort, arginfo_arsort)
|
|
|
|
PHP_FE(sort, arginfo_sort)
|
|
|
|
PHP_FE(rsort, arginfo_rsort)
|
|
|
|
PHP_FE(usort, arginfo_usort)
|
|
|
|
PHP_FE(uasort, arginfo_uasort)
|
|
|
|
PHP_FE(uksort, arginfo_uksort)
|
|
|
|
PHP_FE(shuffle, arginfo_shuffle)
|
|
|
|
PHP_FE(array_walk, arginfo_array_walk)
|
|
|
|
PHP_FE(array_walk_recursive, arginfo_array_walk_recursive)
|
|
|
|
PHP_FE(count, arginfo_count)
|
|
|
|
PHP_FE(end, arginfo_end)
|
|
|
|
PHP_FE(prev, arginfo_prev)
|
|
|
|
PHP_FE(next, arginfo_next)
|
|
|
|
PHP_FE(reset, arginfo_reset)
|
|
|
|
PHP_FE(current, arginfo_current)
|
|
|
|
PHP_FE(key, arginfo_key)
|
|
|
|
PHP_FE(min, arginfo_min)
|
|
|
|
PHP_FE(max, arginfo_max)
|
|
|
|
PHP_FE(in_array, arginfo_in_array)
|
|
|
|
PHP_FE(array_search, arginfo_array_search)
|
|
|
|
PHP_FE(extract, arginfo_extract)
|
|
|
|
PHP_FE(compact, arginfo_compact)
|
|
|
|
PHP_FE(array_fill, arginfo_array_fill)
|
2006-07-15 10:21:10 +00:00
|
|
|
PHP_FE(array_fill_keys, arginfo_array_fill_keys)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(range, arginfo_range)
|
|
|
|
PHP_FE(array_multisort, arginfo_array_multisort)
|
|
|
|
PHP_FE(array_push, arginfo_array_push)
|
|
|
|
PHP_FE(array_pop, arginfo_array_pop)
|
|
|
|
PHP_FE(array_shift, arginfo_array_shift)
|
|
|
|
PHP_FE(array_unshift, arginfo_array_unshift)
|
|
|
|
PHP_FE(array_splice, arginfo_array_splice)
|
|
|
|
PHP_FE(array_slice, arginfo_array_slice)
|
|
|
|
PHP_FE(array_merge, arginfo_array_merge)
|
|
|
|
PHP_FE(array_merge_recursive, arginfo_array_merge_recursive)
|
2008-07-31 20:18:17 +00:00
|
|
|
PHP_FE(array_replace, arginfo_array_replace)
|
|
|
|
PHP_FE(array_replace_recursive, arginfo_array_replace_recursive)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(array_keys, arginfo_array_keys)
|
2018-07-17 08:29:55 +00:00
|
|
|
PHP_FE(array_key_first, arginfo_array_key_first)
|
|
|
|
PHP_FE(array_key_last, arginfo_array_key_last)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(array_values, arginfo_array_values)
|
|
|
|
PHP_FE(array_count_values, arginfo_array_count_values)
|
2012-04-14 04:17:56 +00:00
|
|
|
PHP_FE(array_column, arginfo_array_column)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(array_reverse, arginfo_array_reverse)
|
|
|
|
PHP_FE(array_reduce, arginfo_array_reduce)
|
|
|
|
PHP_FE(array_pad, arginfo_array_pad)
|
|
|
|
PHP_FE(array_flip, arginfo_array_flip)
|
|
|
|
PHP_FE(array_change_key_case, arginfo_array_change_key_case)
|
|
|
|
PHP_FE(array_rand, arginfo_array_rand)
|
|
|
|
PHP_FE(array_unique, arginfo_array_unique)
|
|
|
|
PHP_FE(array_intersect, arginfo_array_intersect)
|
|
|
|
PHP_FE(array_intersect_key, arginfo_array_intersect_key)
|
|
|
|
PHP_FE(array_intersect_ukey, arginfo_array_intersect_ukey)
|
|
|
|
PHP_FE(array_uintersect, arginfo_array_uintersect)
|
|
|
|
PHP_FE(array_intersect_assoc, arginfo_array_intersect_assoc)
|
|
|
|
PHP_FE(array_uintersect_assoc, arginfo_array_uintersect_assoc)
|
|
|
|
PHP_FE(array_intersect_uassoc, arginfo_array_intersect_uassoc)
|
|
|
|
PHP_FE(array_uintersect_uassoc, arginfo_array_uintersect_uassoc)
|
|
|
|
PHP_FE(array_diff, arginfo_array_diff)
|
|
|
|
PHP_FE(array_diff_key, arginfo_array_diff_key)
|
|
|
|
PHP_FE(array_diff_ukey, arginfo_array_diff_ukey)
|
|
|
|
PHP_FE(array_udiff, arginfo_array_udiff)
|
|
|
|
PHP_FE(array_diff_assoc, arginfo_array_diff_assoc)
|
|
|
|
PHP_FE(array_udiff_assoc, arginfo_array_udiff_assoc)
|
|
|
|
PHP_FE(array_diff_uassoc, arginfo_array_diff_uassoc)
|
|
|
|
PHP_FE(array_udiff_uassoc, arginfo_array_udiff_uassoc)
|
|
|
|
PHP_FE(array_sum, arginfo_array_sum)
|
|
|
|
PHP_FE(array_product, arginfo_array_product)
|
|
|
|
PHP_FE(array_filter, arginfo_array_filter)
|
|
|
|
PHP_FE(array_map, arginfo_array_map)
|
|
|
|
PHP_FE(array_chunk, arginfo_array_chunk)
|
|
|
|
PHP_FE(array_combine, arginfo_array_combine)
|
|
|
|
PHP_FE(array_key_exists, arginfo_array_key_exists)
|
2000-06-10 18:58:45 +00:00
|
|
|
|
2000-03-06 20:37:11 +00:00
|
|
|
/* aliases from array.c */
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FALIAS(pos, current, arginfo_current)
|
|
|
|
PHP_FALIAS(sizeof, count, arginfo_count)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FALIAS(key_exists, array_key_exists, arginfo_array_key_exists)
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2000-03-06 20:37:11 +00:00
|
|
|
/* functions from assert.c */
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(assert, arginfo_assert)
|
|
|
|
PHP_FE(assert_options, arginfo_assert_options)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* functions from versioning.c */
|
|
|
|
PHP_FE(version_compare, arginfo_version_compare)
|
2001-10-05 23:56:19 +00:00
|
|
|
|
2001-11-15 09:53:40 +00:00
|
|
|
/* functions from ftok.c*/
|
2002-10-20 13:35:56 +00:00
|
|
|
#if HAVE_FTOK
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(ftok, arginfo_ftok)
|
2002-10-20 13:35:56 +00:00
|
|
|
#endif
|
2001-11-15 09:53:40 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_FE(str_rot13, arginfo_str_rot13)
|
|
|
|
PHP_FE(stream_get_filters, arginfo_stream_get_filters)
|
|
|
|
PHP_FE(stream_filter_register, arginfo_stream_filter_register)
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(stream_bucket_make_writeable, arginfo_stream_bucket_make_writeable)
|
|
|
|
PHP_FE(stream_bucket_prepend, arginfo_stream_bucket_prepend)
|
|
|
|
PHP_FE(stream_bucket_append, arginfo_stream_bucket_append)
|
|
|
|
PHP_FE(stream_bucket_new, arginfo_stream_bucket_new)
|
2002-02-21 03:32:42 +00:00
|
|
|
|
2006-06-26 22:41:22 +00:00
|
|
|
PHP_FE(output_add_rewrite_var, arginfo_output_add_rewrite_var)
|
|
|
|
PHP_FE(output_reset_rewrite_vars, arginfo_output_reset_rewrite_vars)
|
2002-05-03 08:00:41 +00:00
|
|
|
|
2006-12-09 18:00:52 +00:00
|
|
|
PHP_FE(sys_get_temp_dir, arginfo_sys_get_temp_dir)
|
2007-10-01 12:40:54 +00:00
|
|
|
|
Fixed the UTF-8 and long path support in the streams on Windows.
Since long the default PHP charset is UTF-8, however the Windows part is
out of step with this important point. The current implementation in PHP
doesn't technically permit to handle UTF-8 filepath and several other
things. Till now, only the ANSI compatible APIs are being used. Here is more
about it
https://msdn.microsoft.com/en-us/library/windows/desktop/dd317752%28v=vs.85%29.aspx
The patch fixes not only issues with multibyte filenames under
incompatible codepages, but indirectly also issues with some other multibyte
encodings like BIG5, Shift-JIS, etc. by providing a clean way to access
filenames in UTF-8. Below is a small list of issues from the bug tracker,
that are getting fixed:
https://bugs.php.net/63401
https://bugs.php.net/41199
https://bugs.php.net/50203
https://bugs.php.net/71509
https://bugs.php.net/64699
https://bugs.php.net/64506
https://bugs.php.net/30195
https://bugs.php.net/65358
https://bugs.php.net/61315
https://bugs.php.net/70943
https://bugs.php.net/70903
https://bugs.php.net/63593
https://bugs.php.net/54977
https://bugs.php.net/54028
https://bugs.php.net/43148
https://bugs.php.net/30730
https://bugs.php.net/33350
https://bugs.php.net/35300
https://bugs.php.net/46990
https://bugs.php.net/61309
https://bugs.php.net/69333
https://bugs.php.net/45517
https://bugs.php.net/70551
https://bugs.php.net/50197
https://bugs.php.net/72200
https://bugs.php.net/37672
Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow
and Github. Some of the bugs are pretty recent, some descend to early
2000th, but the user comments in there last even till today. Just for example,
bug #30195 was opened in 2004, the latest comment in there was made in 2014. It
is certain, that these bugs descend not only to pure PHP use cases, but get also
redirected from the popular PHP based projects. Given the modern systems (and
those supported by PHP) are always based on NTFS, there is no excuse to keep
these issues unresolved.
The internalization approach on Windows is in many ways different from
UNIX and Linux, while it supports and is based on Unicode. It depends on the
current system code page, APIs used and exact kind how the binary was compiled
The locale doesn't affect the way Unicode or ANSI API work. PHP in particular
is being compiled without _UNICODE defined and this is conditioned by the
way we handle strings. Here is more about it
https://msdn.microsoft.com/en-us/library/tsbaswba.aspx
However, with any system code page ANSI functions automatically convert
paths to UTF-16. Paths in some encodings incompatible with the
current system code page, won't work correctly with ANSI APIs. PHP
till now only uses the ANSI Windows APIs.
For example, on a system with the current code page 1252, the paths
in cp1252 are supported and transparently converted to UTF-16 by the
ANSI functions. Once one wants to handle a filepath encoded with cp932 on
that particular system, an ANSI or a POSIX compatible function used in
PHP will produce an erroneous result. When trying to convert that cp932 path
to UTF-8 and passing to the ANSI functions, an ANSI function would
likely interpret the UTF-8 string as some string in the current code page and
create a filepath that represents every single byte of the UTF-8 string.
These behaviors are not only broken but also disregard the documented
INI settings.
This patch solves the issies with the multibyte paths on Windows by
intelligently enforcing the usage of the Unicode aware APIs. For
functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments
will be converted to UTF-16 wide chars. For functions returning Unicode
aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is
converted back to char's depending on the current PHP charset settings,
either to the current ANSI codepage (this is the behavior prior to this patch)
or to UTF-8 (the default behavior).
In a particular case, users might have to explicitly set
internal_encoding or default_charset, if filenames in ANSI codepage are
necessary. Current tests show no regressions and witness that this will be an
exotic case, the current default UTF-8 encoding is compatible with any
supported system. The dependency libraries are long switching to Unicode APIs,
so some tests were also added for extensions not directly related to streams.
At large, the patch brings over 150 related tests into the core. Those target
and was run on various environments with European, Asian, etc. codepages.
General PHP frameworks was tested and showed no regressions.
The impact on the current C code base is low, the most places affected
are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c
and plain_wrapper.c. The actual implementation of the most of the wide
char supporting functionality is in win32/ioutil.* and win32/codepage.*,
several low level functionsare extended in place to avoid reimplementation for
now. No performance impact was sighted. As previously mentioned, the ANSI APIs
used prior the patch perform Unicode conversions internally. Using the
Unicode APIs directly while doing custom conversions just retains the status
quo. The ways to optimize it are open (fe. by implementing caching for the
strings converted to wide variants).
The long path implementation is user transparent. If a path exceeds the
length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN
is set to 2048 bytes.
Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas
and testing.
Thanks.
2016-06-20 07:32:19 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
PHP_FE(sapi_windows_cp_set, arginfo_sapi_windows_cp_set)
|
|
|
|
PHP_FE(sapi_windows_cp_get, arginfo_sapi_windows_cp_get)
|
|
|
|
PHP_FE(sapi_windows_cp_is_utf8, arginfo_sapi_windows_cp_is_utf8)
|
|
|
|
PHP_FE(sapi_windows_cp_conv, arginfo_sapi_windows_cp_conv)
|
|
|
|
#endif
|
2011-07-25 11:35:02 +00:00
|
|
|
PHP_FE_END
|
1999-04-17 00:37:12 +00:00
|
|
|
};
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
static const zend_module_dep standard_deps[] = { /* {{{ */
|
2006-08-28 19:57:57 +00:00
|
|
|
ZEND_MOD_OPTIONAL("session")
|
2011-08-06 14:47:44 +00:00
|
|
|
ZEND_MOD_END
|
2006-08-28 19:57:57 +00:00
|
|
|
};
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
zend_module_entry basic_functions_module = { /* {{{ */
|
|
|
|
STANDARD_MODULE_HEADER_EX,
|
2006-08-28 19:57:57 +00:00
|
|
|
NULL,
|
|
|
|
standard_deps,
|
2000-03-06 18:44:01 +00:00
|
|
|
"standard", /* extension name */
|
1999-04-17 00:37:12 +00:00
|
|
|
basic_functions, /* function list */
|
1999-07-26 20:09:08 +00:00
|
|
|
PHP_MINIT(basic), /* process startup */
|
|
|
|
PHP_MSHUTDOWN(basic), /* process shutdown */
|
|
|
|
PHP_RINIT(basic), /* request startup */
|
|
|
|
PHP_RSHUTDOWN(basic), /* request shutdown */
|
2000-03-06 20:37:11 +00:00
|
|
|
PHP_MINFO(basic), /* extension info */
|
2015-03-23 20:30:22 +00:00
|
|
|
PHP_STANDARD_VERSION, /* extension version */
|
2001-05-22 19:19:04 +00:00
|
|
|
STANDARD_MODULE_PROPERTIES
|
1999-04-17 00:37:12 +00:00
|
|
|
};
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
#if defined(HAVE_PUTENV)
|
2014-02-10 08:18:01 +00:00
|
|
|
static void php_putenv_destructor(zval *zv) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
putenv_entry *pe = Z_PTR_P(zv);
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
if (pe->previous_value) {
|
2015-03-29 11:18:25 +00:00
|
|
|
# if defined(PHP_WIN32)
|
2015-03-29 04:57:11 +00:00
|
|
|
/* MSVCRT has a bug in putenv() when setting a variable that
|
2004-04-22 14:26:03 +00:00
|
|
|
* is already set; if the SetEnvironmentVariable() API call
|
|
|
|
* fails, the Crt will double free() a string.
|
|
|
|
* We try to avoid this by setting our own value first */
|
|
|
|
SetEnvironmentVariable(pe->key, "bugbug");
|
2015-03-29 11:18:25 +00:00
|
|
|
# endif
|
1999-04-17 00:37:12 +00:00
|
|
|
putenv(pe->previous_value);
|
2008-05-12 08:47:01 +00:00
|
|
|
# if defined(PHP_WIN32)
|
2006-12-10 01:23:41 +00:00
|
|
|
efree(pe->previous_value);
|
2008-05-12 08:47:01 +00:00
|
|
|
# endif
|
1999-04-17 00:37:12 +00:00
|
|
|
} else {
|
|
|
|
# if HAVE_UNSETENV
|
|
|
|
unsetenv(pe->key);
|
2003-07-24 08:02:08 +00:00
|
|
|
# elif defined(PHP_WIN32)
|
|
|
|
SetEnvironmentVariable(pe->key, NULL);
|
2015-02-18 14:27:27 +00:00
|
|
|
# ifndef ZTS
|
|
|
|
_putenv_s(pe->key, "");
|
|
|
|
# endif
|
1999-04-17 00:37:12 +00:00
|
|
|
# else
|
|
|
|
char **env;
|
2000-12-18 19:23:50 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
for (env = environ; env != NULL && *env != NULL; env++) {
|
2001-08-29 16:00:30 +00:00
|
|
|
if (!strncmp(*env, pe->key, pe->key_len) && (*env)[pe->key_len] == '=') { /* found it */
|
1999-04-17 00:37:12 +00:00
|
|
|
*env = "";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
}
|
2003-10-15 00:18:53 +00:00
|
|
|
#ifdef HAVE_TZSET
|
|
|
|
/* don't forget to reset the various libc globals that
|
|
|
|
* we might have changed by an earlier call to tzset(). */
|
|
|
|
if (!strncmp(pe->key, "TZ", pe->key_len)) {
|
|
|
|
tzset();
|
|
|
|
}
|
|
|
|
#endif
|
2007-10-01 12:40:54 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
efree(pe->putenv_string);
|
|
|
|
efree(pe->key);
|
2014-02-27 18:21:02 +00:00
|
|
|
efree(pe);
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
#endif
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */
|
1999-12-13 18:31:29 +00:00
|
|
|
{
|
2004-01-19 19:01:17 +00:00
|
|
|
BG(mt_rand_is_seeded) = 0;
|
2016-07-05 10:54:07 +00:00
|
|
|
BG(mt_rand_mode) = MT_RAND_MT19937;
|
2006-05-14 16:06:48 +00:00
|
|
|
BG(umask) = -1;
|
1999-12-13 18:31:29 +00:00
|
|
|
BG(next) = NULL;
|
|
|
|
BG(left) = -1;
|
2000-09-02 15:54:18 +00:00
|
|
|
BG(user_tick_functions) = NULL;
|
2002-12-31 18:39:36 +00:00
|
|
|
BG(user_filter_map) = NULL;
|
2011-11-09 22:16:31 +00:00
|
|
|
BG(serialize_lock) = 0;
|
2015-01-03 09:22:58 +00:00
|
|
|
|
2010-06-03 15:08:06 +00:00
|
|
|
memset(&BG(serialize), 0, sizeof(BG(serialize)));
|
|
|
|
memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
|
2000-09-19 17:37:34 +00:00
|
|
|
|
2016-08-10 23:03:45 +00:00
|
|
|
memset(&BG(url_adapt_session_ex), 0, sizeof(BG(url_adapt_session_ex)));
|
|
|
|
memset(&BG(url_adapt_output_ex), 0, sizeof(BG(url_adapt_output_ex)));
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2016-08-20 20:39:14 +00:00
|
|
|
BG(url_adapt_session_ex).type = 1;
|
|
|
|
BG(url_adapt_output_ex).type = 0;
|
|
|
|
|
|
|
|
zend_hash_init(&BG(url_adapt_session_hosts_ht), 0, NULL, NULL, 1);
|
|
|
|
zend_hash_init(&BG(url_adapt_output_hosts_ht), 0, NULL, NULL, 1);
|
|
|
|
|
2005-11-20 18:07:28 +00:00
|
|
|
#if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
|
|
|
|
memset(&BG(mblen_state), 0, sizeof(BG(mblen_state)));
|
|
|
|
#endif
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2005-12-07 17:36:17 +00:00
|
|
|
BG(incomplete_class) = incomplete_class_entry;
|
2008-11-29 00:44:33 +00:00
|
|
|
BG(page_uid) = -1;
|
|
|
|
BG(page_gid) = -1;
|
1999-12-13 18:31:29 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-12-13 18:31:29 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
static void basic_globals_dtor(php_basic_globals *basic_globals_p) /* {{{ */
|
2000-01-30 20:49:16 +00:00
|
|
|
{
|
2016-08-10 23:03:45 +00:00
|
|
|
if (basic_globals_p->url_adapt_session_ex.tags) {
|
|
|
|
zend_hash_destroy(basic_globals_p->url_adapt_session_ex.tags);
|
|
|
|
free(basic_globals_p->url_adapt_session_ex.tags);
|
|
|
|
}
|
|
|
|
if (basic_globals_p->url_adapt_output_ex.tags) {
|
|
|
|
zend_hash_destroy(basic_globals_p->url_adapt_output_ex.tags);
|
|
|
|
free(basic_globals_p->url_adapt_output_ex.tags);
|
2004-05-12 10:17:12 +00:00
|
|
|
}
|
2016-08-20 20:39:14 +00:00
|
|
|
|
|
|
|
zend_hash_destroy(&basic_globals_p->url_adapt_session_hosts_ht);
|
|
|
|
zend_hash_destroy(&basic_globals_p->url_adapt_output_hosts_ht);
|
2000-01-30 20:49:16 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2000-01-30 20:49:16 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHPAPI double php_get_nan(void) /* {{{ */
|
2004-03-25 22:36:36 +00:00
|
|
|
{
|
2016-03-20 01:32:44 +00:00
|
|
|
return ZEND_NAN;
|
2004-03-25 22:36:36 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2004-03-25 22:36:36 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHPAPI double php_get_inf(void) /* {{{ */
|
2004-03-25 22:36:36 +00:00
|
|
|
{
|
2016-03-20 01:32:44 +00:00
|
|
|
return ZEND_INFINITY;
|
2004-03-25 22:36:36 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2004-03-25 22:36:36 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
#define BASIC_MINIT_SUBMODULE(module) \
|
|
|
|
if (PHP_MINIT(module)(INIT_FUNC_ARGS_PASSTHRU) == SUCCESS) {\
|
2011-09-05 09:34:14 +00:00
|
|
|
BASIC_ADD_SUBMODULE(module); \
|
2011-06-03 01:44:37 +00:00
|
|
|
}
|
2011-09-05 09:27:23 +00:00
|
|
|
|
|
|
|
#define BASIC_ADD_SUBMODULE(module) \
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_hash_str_add_empty_element(&basic_submodules, #module, strlen(#module));
|
2015-01-03 09:22:58 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
#define BASIC_RINIT_SUBMODULE(module) \
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
|
2011-06-03 01:44:37 +00:00
|
|
|
PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BASIC_MINFO_SUBMODULE(module) \
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
|
2011-06-03 01:44:37 +00:00
|
|
|
PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BASIC_RSHUTDOWN_SUBMODULE(module) \
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
|
2011-06-03 01:44:37 +00:00
|
|
|
PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BASIC_MSHUTDOWN_SUBMODULE(module) \
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \
|
2011-06-03 01:44:37 +00:00
|
|
|
PHP_MSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS_PASSTHRU); \
|
|
|
|
}
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_MINIT_FUNCTION(basic) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
1999-11-28 00:31:02 +00:00
|
|
|
#ifdef ZTS
|
2001-07-27 10:16:41 +00:00
|
|
|
ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
|
2004-07-29 02:59:44 +00:00
|
|
|
#ifdef PHP_WIN32
|
2006-11-10 11:42:07 +00:00
|
|
|
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 );
|
2004-07-29 02:59:44 +00:00
|
|
|
#endif
|
1999-12-13 18:31:29 +00:00
|
|
|
#else
|
2014-12-13 22:06:14 +00:00
|
|
|
basic_globals_ctor(&basic_globals);
|
2004-07-29 02:59:44 +00:00
|
|
|
#ifdef PHP_WIN32
|
2014-12-13 22:06:14 +00:00
|
|
|
php_win32_core_globals_ctor(&the_php_win32_core_globals);
|
2004-07-29 02:59:44 +00:00
|
|
|
#endif
|
1999-11-28 00:31:02 +00:00
|
|
|
#endif
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
zend_hash_init(&basic_submodules, 0, NULL, NULL, 1);
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class();
|
2005-12-07 17:36:17 +00:00
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("CONNECTION_NORMAL", PHP_CONNECTION_NORMAL, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("CONNECTION_TIMEOUT", PHP_CONNECTION_TIMEOUT, CONST_CS | CONST_PERSISTENT);
|
|
|
|
|
|
|
|
REGISTER_LONG_CONSTANT("INI_USER", ZEND_INI_USER, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("INI_PERDIR", ZEND_INI_PERDIR, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("INI_SYSTEM", ZEND_INI_SYSTEM, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("INI_ALL", ZEND_INI_ALL, CONST_CS | CONST_PERSISTENT);
|
|
|
|
|
|
|
|
REGISTER_LONG_CONSTANT("INI_SCANNER_NORMAL", ZEND_INI_SCANNER_NORMAL, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("INI_SCANNER_RAW", ZEND_INI_SCANNER_RAW, CONST_CS | CONST_PERSISTENT);
|
2014-09-01 13:22:28 +00:00
|
|
|
REGISTER_LONG_CONSTANT("INI_SCANNER_TYPED", ZEND_INI_SCANNER_TYPED, CONST_CS | CONST_PERSISTENT);
|
2014-08-25 17:24:55 +00:00
|
|
|
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_PORT", PHP_URL_PORT, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_USER", PHP_URL_USER, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_PASS", PHP_URL_PASS, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_QUERY_RFC1738", PHP_QUERY_RFC1738, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_QUERY_RFC3986", PHP_QUERY_RFC3986, CONST_CS | CONST_PERSISTENT);
|
2005-12-04 17:44:27 +00:00
|
|
|
|
2000-04-08 23:53:19 +00:00
|
|
|
#define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT)
|
|
|
|
REGISTER_MATH_CONSTANT(M_E);
|
|
|
|
REGISTER_MATH_CONSTANT(M_LOG2E);
|
|
|
|
REGISTER_MATH_CONSTANT(M_LOG10E);
|
|
|
|
REGISTER_MATH_CONSTANT(M_LN2);
|
|
|
|
REGISTER_MATH_CONSTANT(M_LN10);
|
|
|
|
REGISTER_MATH_CONSTANT(M_PI);
|
|
|
|
REGISTER_MATH_CONSTANT(M_PI_2);
|
|
|
|
REGISTER_MATH_CONSTANT(M_PI_4);
|
|
|
|
REGISTER_MATH_CONSTANT(M_1_PI);
|
|
|
|
REGISTER_MATH_CONSTANT(M_2_PI);
|
2006-08-27 19:14:43 +00:00
|
|
|
REGISTER_MATH_CONSTANT(M_SQRTPI);
|
2000-04-08 23:53:19 +00:00
|
|
|
REGISTER_MATH_CONSTANT(M_2_SQRTPI);
|
2006-08-27 19:14:43 +00:00
|
|
|
REGISTER_MATH_CONSTANT(M_LNPI);
|
|
|
|
REGISTER_MATH_CONSTANT(M_EULER);
|
2000-04-08 23:53:19 +00:00
|
|
|
REGISTER_MATH_CONSTANT(M_SQRT2);
|
|
|
|
REGISTER_MATH_CONSTANT(M_SQRT1_2);
|
2006-08-27 19:14:43 +00:00
|
|
|
REGISTER_MATH_CONSTANT(M_SQRT3);
|
2016-03-20 01:32:44 +00:00
|
|
|
REGISTER_DOUBLE_CONSTANT("INF", ZEND_INFINITY, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_DOUBLE_CONSTANT("NAN", ZEND_NAN, CONST_CS | CONST_PERSISTENT);
|
2000-04-08 23:53:19 +00:00
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_UP", PHP_ROUND_HALF_UP, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_DOWN", PHP_ROUND_HALF_DOWN, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_EVEN", PHP_ROUND_HALF_EVEN, CONST_CS | CONST_PERSISTENT);
|
|
|
|
REGISTER_LONG_CONSTANT("PHP_ROUND_HALF_ODD", PHP_ROUND_HALF_ODD, CONST_CS | CONST_PERSISTENT);
|
2008-12-02 16:27:15 +00:00
|
|
|
|
2001-08-29 23:53:22 +00:00
|
|
|
#if ENABLE_TEST_CLASS
|
1999-04-17 00:37:12 +00:00
|
|
|
test_class_startup();
|
2001-08-29 23:53:22 +00:00
|
|
|
#endif
|
|
|
|
|
1999-07-14 16:02:10 +00:00
|
|
|
register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
|
1999-11-21 13:25:04 +00:00
|
|
|
register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
|
2000-07-08 20:38:23 +00:00
|
|
|
register_string_constants(INIT_FUNC_ARGS_PASSTHRU);
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2011-09-05 09:27:23 +00:00
|
|
|
BASIC_ADD_SUBMODULE(dl)
|
|
|
|
BASIC_ADD_SUBMODULE(mail)
|
2013-10-21 11:09:29 +00:00
|
|
|
BASIC_ADD_SUBMODULE(streams)
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(file)
|
|
|
|
BASIC_MINIT_SUBMODULE(pack)
|
|
|
|
BASIC_MINIT_SUBMODULE(browscap)
|
|
|
|
BASIC_MINIT_SUBMODULE(standard_filters)
|
|
|
|
BASIC_MINIT_SUBMODULE(user_filters)
|
2012-06-25 02:44:43 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(password)
|
2016-07-05 10:54:07 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(mt_rand)
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-01-17 20:37:49 +00:00
|
|
|
#if defined(HAVE_LOCALECONV) && defined(ZTS)
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(localeconv)
|
2001-01-14 16:36:30 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2001-07-04 10:10:30 +00:00
|
|
|
#if defined(HAVE_NL_LANGINFO)
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(nl_langinfo)
|
2001-07-04 10:10:30 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2018-01-24 08:33:32 +00:00
|
|
|
#if ZEND_INTRIN_SSE4_2_FUNC_PTR
|
|
|
|
BASIC_MINIT_SUBMODULE(string_intrin)
|
|
|
|
#endif
|
|
|
|
|
2018-02-12 12:46:17 +00:00
|
|
|
#if ZEND_INTRIN_AVX2_FUNC_PTR || ZEND_INTRIN_SSSE3_FUNC_PTR
|
|
|
|
BASIC_MINIT_SUBMODULE(base64_intrin)
|
|
|
|
#endif
|
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(crypt)
|
|
|
|
BASIC_MINIT_SUBMODULE(lcg)
|
2001-05-06 17:55:10 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(dir)
|
2003-01-06 05:59:17 +00:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(syslog)
|
2003-01-06 05:59:17 +00:00
|
|
|
#endif
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(array)
|
|
|
|
BASIC_MINIT_SUBMODULE(assert)
|
|
|
|
BASIC_MINIT_SUBMODULE(url_scanner_ex)
|
2003-01-15 16:29:00 +00:00
|
|
|
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(proc_open)
|
2003-01-15 16:29:00 +00:00
|
|
|
#endif
|
2016-01-12 13:41:44 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(exec)
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(user_streams)
|
|
|
|
BASIC_MINIT_SUBMODULE(imagetypes)
|
2001-08-06 13:36:08 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
php_register_url_stream_wrapper("php", &php_stream_php_wrapper);
|
|
|
|
php_register_url_stream_wrapper("file", &php_plain_files_wrapper);
|
2011-02-04 10:47:41 +00:00
|
|
|
#ifdef HAVE_GLOB
|
2014-12-13 22:06:14 +00:00
|
|
|
php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper);
|
2011-02-04 10:47:41 +00:00
|
|
|
#endif
|
2014-12-13 22:06:14 +00:00
|
|
|
php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper);
|
|
|
|
php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
|
|
|
|
php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);
|
2002-11-19 02:34:13 +00:00
|
|
|
|
2017-08-29 20:03:56 +00:00
|
|
|
#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
|
2009-08-11 22:07:35 +00:00
|
|
|
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(dns)
|
2002-11-19 02:34:13 +00:00
|
|
|
# endif
|
2002-08-12 15:56:13 +00:00
|
|
|
#endif
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2015-02-21 15:30:43 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(random)
|
|
|
|
|
2018-01-07 14:55:12 +00:00
|
|
|
BASIC_MINIT_SUBMODULE(hrtime)
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
return SUCCESS;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2006-03-20 23:32:58 +00:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
|
|
|
PHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
|
|
|
|
#endif
|
1999-11-28 00:31:02 +00:00
|
|
|
#ifdef ZTS
|
|
|
|
ts_free_id(basic_globals_id);
|
2004-07-29 02:59:44 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
ts_free_id(php_win32_core_globals_id);
|
|
|
|
#endif
|
2001-07-28 11:36:37 +00:00
|
|
|
#else
|
2014-12-13 22:06:14 +00:00
|
|
|
basic_globals_dtor(&basic_globals);
|
2006-11-10 11:42:07 +00:00
|
|
|
#ifdef PHP_WIN32
|
2014-12-13 22:06:14 +00:00
|
|
|
php_win32_core_globals_dtor(&the_php_win32_core_globals);
|
2006-11-10 11:42:07 +00:00
|
|
|
#endif
|
1999-11-28 00:31:02 +00:00
|
|
|
#endif
|
2000-01-30 20:49:16 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
php_unregister_url_stream_wrapper("php");
|
|
|
|
php_unregister_url_stream_wrapper("http");
|
|
|
|
php_unregister_url_stream_wrapper("ftp");
|
2002-03-15 21:03:08 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(browscap)
|
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(array)
|
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(assert)
|
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(url_scanner_ex)
|
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(file)
|
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(standard_filters)
|
2001-01-17 20:37:49 +00:00
|
|
|
#if defined(HAVE_LOCALECONV) && defined(ZTS)
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(localeconv)
|
2001-01-14 16:36:30 +00:00
|
|
|
#endif
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(crypt)
|
2015-02-21 15:30:43 +00:00
|
|
|
BASIC_MSHUTDOWN_SUBMODULE(random)
|
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
zend_hash_destroy(&basic_submodules);
|
2000-12-18 19:23:50 +00:00
|
|
|
return SUCCESS;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_RINIT_FUNCTION(basic) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2001-08-03 08:49:19 +00:00
|
|
|
memset(BG(strtok_table), 0, 256);
|
2012-10-26 12:36:47 +00:00
|
|
|
|
|
|
|
BG(serialize_lock) = 0;
|
|
|
|
memset(&BG(serialize), 0, sizeof(BG(serialize)));
|
|
|
|
memset(&BG(unserialize), 0, sizeof(BG(unserialize)));
|
|
|
|
|
1999-11-28 00:31:02 +00:00
|
|
|
BG(strtok_string) = NULL;
|
2014-02-10 08:18:01 +00:00
|
|
|
ZVAL_UNDEF(&BG(strtok_zval));
|
2008-11-24 19:17:34 +00:00
|
|
|
BG(strtok_last) = NULL;
|
1999-11-28 00:31:02 +00:00
|
|
|
BG(locale_string) = NULL;
|
2015-01-08 22:41:13 +00:00
|
|
|
BG(locale_changed) = 0;
|
2007-11-02 19:40:39 +00:00
|
|
|
BG(array_walk_fci) = empty_fcall_info;
|
|
|
|
BG(array_walk_fci_cache) = empty_fcall_info_cache;
|
|
|
|
BG(user_compare_fci) = empty_fcall_info;
|
|
|
|
BG(user_compare_fci_cache) = empty_fcall_info_cache;
|
1999-12-12 16:14:40 +00:00
|
|
|
BG(page_uid) = -1;
|
2001-07-09 17:36:04 +00:00
|
|
|
BG(page_gid) = -1;
|
1999-12-12 16:14:40 +00:00
|
|
|
BG(page_inode) = -1;
|
|
|
|
BG(page_mtime) = -1;
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
#ifdef HAVE_PUTENV
|
2014-04-21 14:25:34 +00:00
|
|
|
zend_hash_init(&BG(putenv_ht), 1, NULL, php_putenv_destructor, 0);
|
1999-04-17 00:37:12 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
BG(user_shutdown_function_names) = NULL;
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2011-06-07 01:58:56 +00:00
|
|
|
PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
|
2003-01-06 05:59:17 +00:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_RINIT_SUBMODULE(syslog)
|
2003-01-06 05:59:17 +00:00
|
|
|
#endif
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_RINIT_SUBMODULE(dir)
|
|
|
|
BASIC_RINIT_SUBMODULE(url_scanner_ex)
|
2007-11-02 19:40:39 +00:00
|
|
|
|
2003-05-21 21:36:51 +00:00
|
|
|
/* Setup default context */
|
|
|
|
FG(default_context) = NULL;
|
|
|
|
|
2004-06-21 18:58:55 +00:00
|
|
|
/* Default to global wrappers only */
|
|
|
|
FG(stream_wrappers) = NULL;
|
|
|
|
|
2004-06-21 21:08:05 +00:00
|
|
|
/* Default to global filters only */
|
|
|
|
FG(stream_filters) = NULL;
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
return SUCCESS;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_RSHUTDOWN_FUNCTION(basic) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval_ptr_dtor(&BG(strtok_zval));
|
|
|
|
ZVAL_UNDEF(&BG(strtok_zval));
|
2001-07-08 23:28:48 +00:00
|
|
|
BG(strtok_string) = NULL;
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
#ifdef HAVE_PUTENV
|
1999-11-28 00:31:02 +00:00
|
|
|
zend_hash_destroy(&BG(putenv_ht));
|
1999-04-17 00:37:12 +00:00
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2017-03-08 03:43:14 +00:00
|
|
|
BG(mt_rand_is_seeded) = 0;
|
|
|
|
|
2006-05-14 16:06:48 +00:00
|
|
|
if (BG(umask) != -1) {
|
|
|
|
umask(BG(umask));
|
|
|
|
}
|
|
|
|
|
1999-10-08 02:10:57 +00:00
|
|
|
/* Check if locale was changed and change it back
|
2007-10-01 12:40:54 +00:00
|
|
|
* to the value in startup environment */
|
2015-01-08 22:41:13 +00:00
|
|
|
if (BG(locale_changed)) {
|
2000-06-05 18:47:34 +00:00
|
|
|
setlocale(LC_ALL, "C");
|
|
|
|
setlocale(LC_CTYPE, "");
|
2006-12-04 18:37:15 +00:00
|
|
|
zend_update_current_locale();
|
2015-01-08 22:41:13 +00:00
|
|
|
if (BG(locale_string)) {
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(BG(locale_string), 0);
|
2015-01-08 22:41:13 +00:00
|
|
|
BG(locale_string) = NULL;
|
|
|
|
}
|
2014-02-10 08:18:01 +00:00
|
|
|
}
|
* fixed some #if/#ifdef issues
* hand-patched in php3 changes from 3.0.6 to HEAD in these files:
fopen-wrappers.[ch] ext/standard/file.[ch] ext/standard/fsock.[ch]
ext/standard/php3_string.h ext/standard/string.c
* added some new file/socket macros for more readable code:
FP_FGETS(buf,len,sock,fp,issock)
FP_FREAD(buf,len,sock,fp,issock)
FP_FEOF(sock,fp,issock)
FP_FGETC(sock,fp,issock)
1999-06-16 17:06:53 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* FG(stream_wrappers) and FG(stream_filters) are destroyed
|
|
|
|
* during php_request_shutdown() */
|
|
|
|
|
2011-06-07 01:58:56 +00:00
|
|
|
PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
|
2003-01-06 05:59:17 +00:00
|
|
|
#ifdef HAVE_SYSLOG_H
|
2007-10-01 12:40:54 +00:00
|
|
|
#ifdef PHP_WIN32
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
|
2007-05-17 06:38:13 +00:00
|
|
|
#endif
|
2003-01-06 05:59:17 +00:00
|
|
|
#endif
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(assert)
|
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(url_scanner_ex)
|
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(streams)
|
2004-07-29 11:54:12 +00:00
|
|
|
#ifdef PHP_WIN32
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(win32_core_globals)
|
2004-07-29 11:54:12 +00:00
|
|
|
#endif
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2000-09-01 16:10:17 +00:00
|
|
|
if (BG(user_tick_functions)) {
|
|
|
|
zend_llist_destroy(BG(user_tick_functions));
|
|
|
|
efree(BG(user_tick_functions));
|
|
|
|
BG(user_tick_functions) = NULL;
|
|
|
|
}
|
2002-02-21 03:32:42 +00:00
|
|
|
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(user_filters)
|
|
|
|
BASIC_RSHUTDOWN_SUBMODULE(browscap)
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2008-11-29 00:44:33 +00:00
|
|
|
BG(page_uid) = -1;
|
|
|
|
BG(page_gid) = -1;
|
1999-04-17 00:37:12 +00:00
|
|
|
return SUCCESS;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
PHP_MINFO_FUNCTION(basic) /* {{{ */
|
2000-03-06 20:37:11 +00:00
|
|
|
{
|
2000-06-07 09:55:37 +00:00
|
|
|
php_info_print_table_start();
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINFO_SUBMODULE(dl)
|
|
|
|
BASIC_MINFO_SUBMODULE(mail)
|
2000-06-07 09:55:37 +00:00
|
|
|
php_info_print_table_end();
|
2011-06-03 01:44:37 +00:00
|
|
|
BASIC_MINFO_SUBMODULE(assert)
|
2000-03-06 20:37:11 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2000-11-24 21:05:25 +00:00
|
|
|
/* {{{ proto mixed constant(string const_name)
|
2007-10-01 12:40:54 +00:00
|
|
|
Given the name of a constant this function will return the constant's associated value */
|
2000-11-24 21:05:25 +00:00
|
|
|
PHP_FUNCTION(constant)
|
|
|
|
{
|
2014-04-24 20:56:15 +00:00
|
|
|
zend_string *const_name;
|
|
|
|
zval *c;
|
2016-04-28 01:13:34 +00:00
|
|
|
zend_class_entry *scope;
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STR(const_name)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2016-04-28 01:13:34 +00:00
|
|
|
scope = zend_get_executed_scope();
|
|
|
|
c = zend_get_constant_ex(const_name, scope, ZEND_FETCH_CLASS_SILENT);
|
2014-04-24 20:56:15 +00:00
|
|
|
if (c) {
|
2017-10-30 20:13:10 +00:00
|
|
|
ZVAL_COPY_OR_DUP(return_value, c);
|
2017-10-10 07:11:05 +00:00
|
|
|
if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
|
2016-04-28 01:13:34 +00:00
|
|
|
if (UNEXPECTED(zval_update_constant_ex(return_value, scope) != SUCCESS)) {
|
2015-04-01 23:05:25 +00:00
|
|
|
return;
|
|
|
|
}
|
2014-04-24 20:56:15 +00:00
|
|
|
}
|
|
|
|
} else {
|
2016-08-22 15:44:38 +00:00
|
|
|
if (!EG(exception)) {
|
|
|
|
php_error_docref(NULL, E_WARNING, "Couldn't find constant %s", ZSTR_VAL(const_name));
|
|
|
|
}
|
2001-08-29 16:00:30 +00:00
|
|
|
RETURN_NULL();
|
|
|
|
}
|
2000-11-24 21:05:25 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2004-08-07 04:50:24 +00:00
|
|
|
#ifdef HAVE_INET_NTOP
|
|
|
|
/* {{{ proto string inet_ntop(string in_addr)
|
|
|
|
Converts a packed inet address to a human readable IP address string */
|
2017-11-21 15:04:37 +00:00
|
|
|
PHP_NAMED_FUNCTION(zif_inet_ntop)
|
2004-08-07 04:50:24 +00:00
|
|
|
{
|
|
|
|
char *address;
|
2014-08-27 18:42:47 +00:00
|
|
|
size_t address_len;
|
|
|
|
int af = AF_INET;
|
2004-08-07 04:50:24 +00:00
|
|
|
char buffer[40];
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(address, address_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2004-08-07 04:50:24 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
if (address_len == 16) {
|
|
|
|
af = AF_INET6;
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
if (address_len != 4) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!inet_ntop(af, address, buffer, sizeof(buffer))) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(buffer);
|
2004-08-07 04:50:24 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
#endif /* HAVE_INET_NTOP */
|
|
|
|
|
|
|
|
#ifdef HAVE_INET_PTON
|
|
|
|
/* {{{ proto string inet_pton(string ip_address)
|
|
|
|
Converts a human readable IP address to a packed binary string */
|
2004-08-07 15:59:59 +00:00
|
|
|
PHP_NAMED_FUNCTION(php_inet_pton)
|
2004-08-07 04:50:24 +00:00
|
|
|
{
|
|
|
|
int ret, af = AF_INET;
|
|
|
|
char *address;
|
2014-08-27 18:42:47 +00:00
|
|
|
size_t address_len;
|
2004-08-07 04:50:24 +00:00
|
|
|
char buffer[17];
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(address, address_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2004-08-07 04:50:24 +00:00
|
|
|
|
|
|
|
memset(buffer, 0, sizeof(buffer));
|
|
|
|
|
|
|
|
#ifdef HAVE_IPV6
|
|
|
|
if (strchr(address, ':')) {
|
|
|
|
af = AF_INET6;
|
2007-10-01 12:40:54 +00:00
|
|
|
} else
|
2004-08-07 04:50:24 +00:00
|
|
|
#endif
|
|
|
|
if (!strchr(address, '.')) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = inet_pton(af, address, buffer);
|
|
|
|
|
|
|
|
if (ret <= 0) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRINGL(buffer, af == AF_INET ? 4 : 16);
|
2004-08-07 04:50:24 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
#endif /* HAVE_INET_PTON */
|
|
|
|
|
2001-07-02 11:11:58 +00:00
|
|
|
/* {{{ proto int ip2long(string ip_address)
|
2000-07-26 11:43:01 +00:00
|
|
|
Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address */
|
2000-03-04 17:28:16 +00:00
|
|
|
PHP_FUNCTION(ip2long)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *addr;
|
2014-08-27 18:42:47 +00:00
|
|
|
size_t addr_len;
|
2009-04-28 22:27:00 +00:00
|
|
|
#ifdef HAVE_INET_PTON
|
|
|
|
struct in_addr ip;
|
|
|
|
#else
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_ulong ip;
|
2009-04-28 22:27:00 +00:00
|
|
|
#endif
|
2000-03-04 17:28:16 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(addr, addr_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2000-03-04 17:28:16 +00:00
|
|
|
|
2009-04-28 22:27:00 +00:00
|
|
|
#ifdef HAVE_INET_PTON
|
|
|
|
if (addr_len == 0 || inet_pton(AF_INET, addr, &ip) != 1) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(ntohl(ip.s_addr));
|
2009-04-28 22:27:00 +00:00
|
|
|
#else
|
2007-10-01 12:40:54 +00:00
|
|
|
if (addr_len == 0 || (ip = inet_addr(addr)) == INADDR_NONE) {
|
|
|
|
/* The only special case when we should return -1 ourselves,
|
2007-09-06 13:28:05 +00:00
|
|
|
* because inet_addr() considers it wrong. We return 0xFFFFFFFF and
|
2007-10-01 12:40:54 +00:00
|
|
|
* not -1 or ~0 because of 32/64bit issues. */
|
|
|
|
if (addr_len == sizeof("255.255.255.255") - 1 &&
|
|
|
|
!memcmp(addr, "255.255.255.255", sizeof("255.255.255.255") - 1)
|
|
|
|
) {
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(0xFFFFFFFF);
|
2004-08-19 15:14:04 +00:00
|
|
|
}
|
2004-05-28 10:45:18 +00:00
|
|
|
RETURN_FALSE;
|
2003-12-19 13:33:51 +00:00
|
|
|
}
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(ntohl(ip));
|
2009-04-28 22:27:00 +00:00
|
|
|
#endif
|
2000-03-04 17:28:16 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
2000-03-04 17:28:16 +00:00
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto string long2ip(int proper_address)
|
2000-07-26 11:43:01 +00:00
|
|
|
Converts an (IPv4) Internet network address into a string in Internet standard dotted format */
|
2000-03-04 17:28:16 +00:00
|
|
|
PHP_FUNCTION(long2ip)
|
|
|
|
{
|
2015-12-14 06:55:44 +00:00
|
|
|
zend_ulong ip;
|
2016-12-31 00:06:20 +00:00
|
|
|
zend_long sip;
|
2000-03-04 17:28:16 +00:00
|
|
|
struct in_addr myaddr;
|
2009-10-05 14:45:54 +00:00
|
|
|
#ifdef HAVE_INET_PTON
|
|
|
|
char str[40];
|
|
|
|
#endif
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_LONG(sip)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
|
|
|
|
|
|
|
/* autoboxes on 32bit platforms, but that's expected */
|
|
|
|
ip = (zend_ulong)sip;
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2015-12-14 06:55:44 +00:00
|
|
|
myaddr.s_addr = htonl(ip);
|
2009-10-05 14:45:54 +00:00
|
|
|
#ifdef HAVE_INET_PTON
|
|
|
|
if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(str);
|
2009-10-05 14:45:54 +00:00
|
|
|
} else {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
#else
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(inet_ntoa(myaddr));
|
2009-10-05 14:45:54 +00:00
|
|
|
#endif
|
2000-03-04 17:28:16 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
2000-03-04 17:28:16 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
/********************
|
|
|
|
* System Functions *
|
|
|
|
********************/
|
|
|
|
|
2016-07-19 08:44:14 +00:00
|
|
|
/* {{{ proto string getenv(string varname[, bool local_only]
|
2017-12-31 04:35:25 +00:00
|
|
|
Get the value of an environment variable or every available environment variable
|
2015-10-12 19:24:19 +00:00
|
|
|
if no varname is present */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(getenv)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2015-10-12 19:36:21 +00:00
|
|
|
char *ptr, *str = NULL;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t str_len;
|
2016-07-10 23:17:54 +00:00
|
|
|
zend_bool local_only = 0;
|
2000-02-10 17:55:01 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(0, 2)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_STRING(str, str_len)
|
|
|
|
Z_PARAM_BOOL(local_only)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2015-10-12 19:24:19 +00:00
|
|
|
if (!str) {
|
|
|
|
array_init(return_value);
|
|
|
|
php_import_environment_variables(return_value);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-07-10 23:17:54 +00:00
|
|
|
if (!local_only) {
|
|
|
|
/* SAPI method returns an emalloc()'d string */
|
2016-07-19 08:35:58 +00:00
|
|
|
ptr = sapi_getenv(str, str_len);
|
2016-07-10 23:17:54 +00:00
|
|
|
if (ptr) {
|
2016-07-19 08:35:58 +00:00
|
|
|
// TODO: avoid realocation ???
|
|
|
|
RETVAL_STRING(ptr);
|
|
|
|
efree(ptr);
|
|
|
|
return;
|
2016-07-10 23:17:54 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2008-08-18 07:11:00 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
{
|
2017-11-27 17:49:02 +00:00
|
|
|
wchar_t dummybuf;
|
|
|
|
DWORD size;
|
|
|
|
wchar_t *keyw, *valw;
|
|
|
|
|
|
|
|
keyw = php_win32_cp_conv_any_to_w(str, str_len, PHP_WIN32_CP_IGNORE_LEN_P);
|
|
|
|
if (!keyw) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2008-08-18 07:11:00 +00:00
|
|
|
|
|
|
|
SetLastError(0);
|
2015-01-03 09:22:58 +00:00
|
|
|
/*If the given bugger is not large enough to hold the data, the return value is
|
|
|
|
the buffer size, in characters, required to hold the string and its terminating
|
2008-08-18 07:11:00 +00:00
|
|
|
null character. We use this return value to alloc the final buffer. */
|
2017-11-27 17:49:02 +00:00
|
|
|
size = GetEnvironmentVariableW(keyw, &dummybuf, 0);
|
2008-08-18 07:11:00 +00:00
|
|
|
if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
|
|
|
|
/* The environment variable doesn't exist. */
|
2017-11-27 19:24:30 +00:00
|
|
|
free(keyw);
|
2008-08-18 07:11:00 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size == 0) {
|
|
|
|
/* env exists, but it is empty */
|
2017-11-27 19:24:30 +00:00
|
|
|
free(keyw);
|
2008-08-18 07:11:00 +00:00
|
|
|
RETURN_EMPTY_STRING();
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2017-11-27 20:18:08 +00:00
|
|
|
valw = emalloc((size + 1) * sizeof(wchar_t));
|
2017-11-27 17:49:02 +00:00
|
|
|
size = GetEnvironmentVariableW(keyw, valw, size);
|
2011-09-26 08:49:28 +00:00
|
|
|
if (size == 0) {
|
|
|
|
/* has been removed between the two calls */
|
2017-11-27 17:49:02 +00:00
|
|
|
free(keyw);
|
|
|
|
efree(valw);
|
2011-09-26 08:49:28 +00:00
|
|
|
RETURN_EMPTY_STRING();
|
|
|
|
} else {
|
2017-11-27 17:49:02 +00:00
|
|
|
ptr = php_win32_cp_w_to_any(valw);
|
2014-05-15 08:23:50 +00:00
|
|
|
RETVAL_STRING(ptr);
|
2017-11-27 17:49:02 +00:00
|
|
|
free(ptr);
|
|
|
|
free(keyw);
|
|
|
|
efree(valw);
|
2014-05-15 08:23:50 +00:00
|
|
|
return;
|
2011-09-26 08:49:28 +00:00
|
|
|
}
|
2008-08-18 07:11:00 +00:00
|
|
|
}
|
|
|
|
#else
|
2007-10-01 12:40:54 +00:00
|
|
|
/* system method returns a const */
|
2006-06-26 13:15:20 +00:00
|
|
|
ptr = getenv(str);
|
2007-10-01 12:40:54 +00:00
|
|
|
if (ptr) {
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(ptr);
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2008-08-18 07:11:00 +00:00
|
|
|
#endif
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-05-27 19:27:20 +00:00
|
|
|
#ifdef HAVE_PUTENV
|
2001-07-02 11:11:58 +00:00
|
|
|
/* {{{ proto bool putenv(string setting)
|
2000-03-29 01:39:04 +00:00
|
|
|
Set the value of an environment variable */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(putenv)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *setting;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t setting_len;
|
2014-06-09 06:00:38 +00:00
|
|
|
char *p, **env;
|
|
|
|
putenv_entry pe;
|
|
|
|
#ifdef PHP_WIN32
|
|
|
|
char *value = NULL;
|
|
|
|
int equals = 0;
|
|
|
|
int error_code;
|
|
|
|
#endif
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(setting, setting_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2015-01-03 09:22:58 +00:00
|
|
|
|
2014-06-09 06:00:38 +00:00
|
|
|
if(setting_len == 0 || setting[0] == '=') {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Invalid parameter syntax");
|
2014-06-09 06:00:38 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
pe.putenv_string = estrndup(setting, setting_len);
|
|
|
|
pe.key = estrndup(setting, setting_len);
|
|
|
|
if ((p = strchr(pe.key, '='))) { /* nullify the '=' if there is one */
|
|
|
|
*p = '\0';
|
2008-08-18 07:11:00 +00:00
|
|
|
#ifdef PHP_WIN32
|
2014-06-09 06:00:38 +00:00
|
|
|
equals = 1;
|
2008-08-18 07:11:00 +00:00
|
|
|
#endif
|
2014-06-09 06:00:38 +00:00
|
|
|
}
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2018-03-01 19:52:09 +00:00
|
|
|
pe.key_len = strlen(pe.key);
|
2008-08-18 07:11:00 +00:00
|
|
|
#ifdef PHP_WIN32
|
2014-06-09 06:00:38 +00:00
|
|
|
if (equals) {
|
2018-03-01 19:52:09 +00:00
|
|
|
if (pe.key_len < setting_len - 1) {
|
2014-06-09 06:00:38 +00:00
|
|
|
value = p + 1;
|
|
|
|
} else {
|
|
|
|
/* empty string*/
|
|
|
|
value = p;
|
2008-08-18 07:11:00 +00:00
|
|
|
}
|
2014-06-09 06:00:38 +00:00
|
|
|
}
|
2008-08-18 07:11:00 +00:00
|
|
|
#endif
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2014-06-12 01:07:33 +00:00
|
|
|
zend_hash_str_del(&BG(putenv_ht), pe.key, pe.key_len);
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2014-06-09 06:00:38 +00:00
|
|
|
/* find previous value */
|
|
|
|
pe.previous_value = NULL;
|
|
|
|
for (env = environ; env != NULL && *env != NULL; env++) {
|
|
|
|
if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /* found it */
|
2008-05-12 08:47:01 +00:00
|
|
|
#if defined(PHP_WIN32)
|
2014-06-09 06:00:38 +00:00
|
|
|
/* must copy previous value because MSVCRT's putenv can free the string without notice */
|
|
|
|
pe.previous_value = estrdup(*env);
|
2008-05-12 08:47:01 +00:00
|
|
|
#else
|
2014-06-09 06:00:38 +00:00
|
|
|
pe.previous_value = *env;
|
2008-05-12 08:47:01 +00:00
|
|
|
#endif
|
2014-06-09 06:00:38 +00:00
|
|
|
break;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2014-06-09 06:00:38 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-04-17 20:34:14 +00:00
|
|
|
#if HAVE_UNSETENV
|
2014-06-09 06:00:38 +00:00
|
|
|
if (!p) { /* no '=' means we want to unset it */
|
|
|
|
unsetenv(pe.putenv_string);
|
|
|
|
}
|
|
|
|
if (!p || putenv(pe.putenv_string) == 0) { /* success */
|
2007-04-17 20:34:14 +00:00
|
|
|
#else
|
2008-08-18 07:11:00 +00:00
|
|
|
# ifndef PHP_WIN32
|
2014-06-09 06:00:38 +00:00
|
|
|
if (putenv(pe.putenv_string) == 0) { /* success */
|
2008-08-18 07:11:00 +00:00
|
|
|
# else
|
2017-11-27 17:49:02 +00:00
|
|
|
wchar_t *keyw, *valw = NULL;
|
|
|
|
|
|
|
|
keyw = php_win32_cp_any_to_w(pe.key);
|
|
|
|
if (value) {
|
|
|
|
valw = php_win32_cp_any_to_w(value);
|
|
|
|
}
|
|
|
|
/* valw may be NULL, but the failed conversion still needs to be checked. */
|
|
|
|
if (!keyw || !valw && value) {
|
|
|
|
efree(pe.putenv_string);
|
|
|
|
efree(pe.key);
|
|
|
|
free(keyw);
|
|
|
|
free(valw);
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
error_code = SetEnvironmentVariableW(keyw, valw);
|
2014-11-21 08:57:12 +00:00
|
|
|
|
|
|
|
if (error_code != 0
|
|
|
|
# ifndef ZTS
|
|
|
|
/* We need both SetEnvironmentVariable and _putenv here as some
|
|
|
|
dependency lib could use either way to read the environment.
|
|
|
|
Obviously the CRT version will be useful more often. But
|
|
|
|
generally, doing both brings us on the safe track at least
|
|
|
|
in NTS build. */
|
2017-11-27 17:49:02 +00:00
|
|
|
&& _wputenv_s(keyw, valw ? valw : L"") == 0
|
2014-11-21 08:57:12 +00:00
|
|
|
# endif
|
|
|
|
) { /* success */
|
2008-08-18 07:11:00 +00:00
|
|
|
# endif
|
2007-04-17 20:34:14 +00:00
|
|
|
#endif
|
2014-06-12 01:07:33 +00:00
|
|
|
zend_hash_str_add_mem(&BG(putenv_ht), pe.key, pe.key_len, &pe, sizeof(putenv_entry));
|
2001-01-09 09:02:21 +00:00
|
|
|
#ifdef HAVE_TZSET
|
2014-06-09 06:00:38 +00:00
|
|
|
if (!strncmp(pe.key, "TZ", pe.key_len)) {
|
|
|
|
tzset();
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2017-11-27 17:49:02 +00:00
|
|
|
#endif
|
|
|
|
#if defined(PHP_WIN32)
|
|
|
|
free(keyw);
|
|
|
|
free(valw);
|
2014-06-09 06:00:38 +00:00
|
|
|
#endif
|
|
|
|
RETURN_TRUE;
|
|
|
|
} else {
|
|
|
|
efree(pe.putenv_string);
|
|
|
|
efree(pe.key);
|
2017-11-27 17:49:02 +00:00
|
|
|
#if defined(PHP_WIN32)
|
|
|
|
free(keyw);
|
|
|
|
free(valw);
|
|
|
|
#endif
|
2014-06-09 06:00:38 +00:00
|
|
|
RETURN_FALSE;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
2000-05-27 19:27:20 +00:00
|
|
|
#endif
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* {{{ free_argv()
|
2002-09-30 03:02:52 +00:00
|
|
|
Free the memory allocated to an argv array. */
|
|
|
|
static void free_argv(char **argv, int argc)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (argv) {
|
|
|
|
for (i = 0; i < argc; i++) {
|
|
|
|
if (argv[i]) {
|
|
|
|
efree(argv[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
efree(argv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* {{{ free_longopts()
|
2002-10-21 16:07:21 +00:00
|
|
|
Free the memory allocated to an longopt array. */
|
2007-10-01 12:40:54 +00:00
|
|
|
static void free_longopts(opt_struct *longopts)
|
|
|
|
{
|
|
|
|
opt_struct *p;
|
|
|
|
|
|
|
|
if (longopts) {
|
|
|
|
for (p = longopts; p && p->opt_char != '-'; p++) {
|
|
|
|
if (p->opt_name != NULL) {
|
|
|
|
efree((char *)(p->opt_name));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ parse_opts()
|
|
|
|
Convert the typical getopt input characters to the php_getopt struct array */
|
|
|
|
static int parse_opts(char * opts, opt_struct ** result)
|
2002-10-21 16:07:21 +00:00
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
opt_struct * paras = NULL;
|
2009-06-15 08:32:38 +00:00
|
|
|
unsigned int i, count = 0;
|
2014-09-17 06:59:19 +00:00
|
|
|
unsigned int opts_len = (unsigned int)strlen(opts);
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-09-17 06:59:19 +00:00
|
|
|
for (i = 0; i < opts_len; i++) {
|
2007-11-15 13:13:21 +00:00
|
|
|
if ((opts[i] >= 48 && opts[i] <= 57) ||
|
|
|
|
(opts[i] >= 65 && opts[i] <= 90) ||
|
2007-10-01 12:40:54 +00:00
|
|
|
(opts[i] >= 97 && opts[i] <= 122)
|
|
|
|
) {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
2002-10-21 16:07:21 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
paras = safe_emalloc(sizeof(opt_struct), count, 0);
|
|
|
|
memset(paras, 0, sizeof(opt_struct) * count);
|
|
|
|
*result = paras;
|
2007-11-15 13:13:21 +00:00
|
|
|
while ( (*opts >= 48 && *opts <= 57) || /* 0 - 9 */
|
|
|
|
(*opts >= 65 && *opts <= 90) || /* A - Z */
|
|
|
|
(*opts >= 97 && *opts <= 122) /* a - z */
|
2007-10-01 12:40:54 +00:00
|
|
|
) {
|
|
|
|
paras->opt_char = *opts;
|
2018-08-19 04:32:00 +00:00
|
|
|
paras->need_param = *(++opts) == ':';
|
2007-10-01 12:40:54 +00:00
|
|
|
paras->opt_name = NULL;
|
|
|
|
if (paras->need_param == 1) {
|
|
|
|
opts++;
|
2007-11-21 10:24:22 +00:00
|
|
|
if (*opts == ':') {
|
|
|
|
paras->need_param++;
|
|
|
|
opts++;
|
|
|
|
}
|
2002-10-21 16:07:21 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
paras++;
|
2002-10-21 16:07:21 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
return count;
|
2002-10-21 16:07:21 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2016-05-29 17:44:16 +00:00
|
|
|
/* {{{ proto array getopt(string options [, array longopts [, int &optind]])
|
2002-09-30 03:02:52 +00:00
|
|
|
Get options from the command line argument list */
|
|
|
|
PHP_FUNCTION(getopt)
|
|
|
|
{
|
|
|
|
char *options = NULL, **argv = NULL;
|
2002-10-06 16:33:14 +00:00
|
|
|
char opt[2] = { '\0' };
|
2002-10-21 16:07:21 +00:00
|
|
|
char *optname;
|
2018-03-01 19:52:09 +00:00
|
|
|
int argc = 0, o;
|
|
|
|
size_t options_len = 0, len;
|
2007-10-01 12:40:54 +00:00
|
|
|
char *php_optarg = NULL;
|
|
|
|
int php_optind = 1;
|
2014-02-10 08:18:01 +00:00
|
|
|
zval val, *args = NULL, *p_longopts = NULL;
|
2016-05-29 17:44:16 +00:00
|
|
|
zval *zoptind = NULL;
|
2018-03-01 19:52:09 +00:00
|
|
|
size_t optname_len = 0;
|
2007-10-01 12:40:54 +00:00
|
|
|
opt_struct *opts, *orig_opts;
|
2002-10-21 16:07:21 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 3)
|
|
|
|
Z_PARAM_STRING(options, options_len)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_ARRAY(p_longopts)
|
2017-06-19 09:55:59 +00:00
|
|
|
Z_PARAM_ZVAL_DEREF(zoptind)
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2002-09-30 03:02:52 +00:00
|
|
|
|
2016-05-29 17:44:16 +00:00
|
|
|
/* Init zoptind to 1 */
|
|
|
|
if (zoptind) {
|
2017-06-19 09:55:59 +00:00
|
|
|
zval_ptr_dtor(zoptind);
|
2016-05-29 17:44:16 +00:00
|
|
|
ZVAL_LONG(zoptind, 1);
|
|
|
|
}
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* Get argv from the global symbol table. We calculate argc ourselves
|
2002-09-30 03:02:52 +00:00
|
|
|
* in order to be on the safe side, even though it is also available
|
2007-10-01 12:40:54 +00:00
|
|
|
* from the symbol table. */
|
2015-02-13 05:18:14 +00:00
|
|
|
if ((Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) == IS_ARRAY || zend_is_auto_global_str(ZEND_STRL("_SERVER"))) &&
|
2017-12-04 10:21:35 +00:00
|
|
|
((args = zend_hash_find_ex_ind(Z_ARRVAL_P(&PG(http_globals)[TRACK_VARS_SERVER]), ZSTR_KNOWN(ZEND_STR_ARGV), 1)) != NULL ||
|
|
|
|
(args = zend_hash_find_ex_ind(&EG(symbol_table), ZSTR_KNOWN(ZEND_STR_ARGV), 1)) != NULL)
|
2007-10-01 12:40:54 +00:00
|
|
|
) {
|
2002-09-30 03:02:52 +00:00
|
|
|
int pos = 0;
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *entry;
|
2002-09-30 03:02:52 +00:00
|
|
|
|
2014-03-26 14:07:31 +00:00
|
|
|
if (Z_TYPE_P(args) != IS_ARRAY) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
argc = zend_hash_num_elements(Z_ARRVAL_P(args));
|
2002-09-30 03:02:52 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* Attempt to allocate enough memory to hold all of the arguments
|
|
|
|
* and a trailing NULL */
|
2004-06-27 21:49:47 +00:00
|
|
|
argv = (char **) safe_emalloc(sizeof(char *), (argc + 1), 0);
|
2002-09-30 03:02:52 +00:00
|
|
|
|
|
|
|
/* Iterate over the hash to construct the argv array. */
|
2014-04-18 15:18:11 +00:00
|
|
|
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(args), entry) {
|
2017-11-16 14:09:32 +00:00
|
|
|
zend_string *tmp_arg_str;
|
|
|
|
zend_string *arg_str = zval_get_tmp_string(entry, &tmp_arg_str);
|
2007-11-14 14:42:25 +00:00
|
|
|
|
2015-06-30 01:05:24 +00:00
|
|
|
argv[pos++] = estrdup(ZSTR_VAL(arg_str));
|
2007-11-14 14:42:25 +00:00
|
|
|
|
2017-11-16 14:09:32 +00:00
|
|
|
zend_tmp_string_release(tmp_arg_str);
|
2014-04-18 15:18:11 +00:00
|
|
|
} ZEND_HASH_FOREACH_END();
|
2002-10-06 16:33:14 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* The C Standard requires argv[argc] to be NULL - this might
|
|
|
|
* keep some getopt implementations happy. */
|
2002-10-06 16:33:14 +00:00
|
|
|
argv[argc] = NULL;
|
|
|
|
} else {
|
|
|
|
/* Return false if we can't find argv. */
|
|
|
|
RETURN_FALSE;
|
2002-09-30 03:02:52 +00:00
|
|
|
}
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
len = parse_opts(options, &opts);
|
|
|
|
|
|
|
|
if (p_longopts) {
|
|
|
|
int count;
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *entry;
|
2002-10-21 16:07:21 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
count = zend_hash_num_elements(Z_ARRVAL_P(p_longopts));
|
2002-10-21 16:07:21 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* the first <len> slots are filled by the one short ops
|
|
|
|
* we now extend our array and jump to the new added structs */
|
|
|
|
opts = (opt_struct *) erealloc(opts, sizeof(opt_struct) * (len + count + 1));
|
|
|
|
orig_opts = opts;
|
|
|
|
opts += len;
|
|
|
|
|
|
|
|
memset(opts, 0, count * sizeof(opt_struct));
|
|
|
|
|
2002-10-21 16:07:21 +00:00
|
|
|
/* Iterate over the hash to construct the argv array. */
|
2014-04-18 15:18:11 +00:00
|
|
|
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(p_longopts), entry) {
|
2017-11-16 14:09:32 +00:00
|
|
|
zend_string *tmp_arg_str;
|
|
|
|
zend_string *arg_str = zval_get_tmp_string(entry, &tmp_arg_str);
|
2007-11-14 14:42:25 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
opts->need_param = 0;
|
2015-06-30 01:05:24 +00:00
|
|
|
opts->opt_name = estrdup(ZSTR_VAL(arg_str));
|
2018-03-01 19:52:09 +00:00
|
|
|
len = strlen(opts->opt_name);
|
2007-11-02 19:40:39 +00:00
|
|
|
if ((len > 0) && (opts->opt_name[len - 1] == ':')) {
|
2007-10-01 12:40:54 +00:00
|
|
|
opts->need_param++;
|
2007-11-02 19:40:39 +00:00
|
|
|
opts->opt_name[len - 1] = '\0';
|
|
|
|
if ((len > 1) && (opts->opt_name[len - 2] == ':')) {
|
2007-10-01 12:40:54 +00:00
|
|
|
opts->need_param++;
|
2007-11-02 19:40:39 +00:00
|
|
|
opts->opt_name[len - 2] = '\0';
|
2002-10-21 16:07:21 +00:00
|
|
|
}
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
opts->opt_char = 0;
|
|
|
|
opts++;
|
2007-11-14 14:42:25 +00:00
|
|
|
|
2017-11-16 14:09:32 +00:00
|
|
|
zend_tmp_string_release(tmp_arg_str);
|
2014-04-18 15:18:11 +00:00
|
|
|
} ZEND_HASH_FOREACH_END();
|
2007-10-01 12:40:54 +00:00
|
|
|
} else {
|
|
|
|
opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
|
|
|
|
orig_opts = opts;
|
|
|
|
opts += len;
|
2002-10-21 16:07:21 +00:00
|
|
|
}
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* php_getopt want to identify the last param */
|
|
|
|
opts->opt_char = '-';
|
|
|
|
opts->need_param = 0;
|
|
|
|
opts->opt_name = NULL;
|
|
|
|
|
2002-09-30 03:02:52 +00:00
|
|
|
/* Initialize the return value as an array. */
|
2002-12-05 22:28:02 +00:00
|
|
|
array_init(return_value);
|
2002-09-30 03:02:52 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
/* after our pointer arithmetic jump back to the first element */
|
|
|
|
opts = orig_opts;
|
2005-12-08 03:25:22 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
while ((o = php_getopt(argc, argv, opts, &php_optarg, &php_optind, 0, 1)) != -1) {
|
2002-09-30 03:02:52 +00:00
|
|
|
/* Skip unknown arguments. */
|
2002-10-06 16:33:14 +00:00
|
|
|
if (o == '?') {
|
2002-09-30 03:02:52 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Prepare the option character and the argument string. */
|
2007-10-01 12:40:54 +00:00
|
|
|
if (o == 0) {
|
|
|
|
optname = opts[php_optidx].opt_name;
|
|
|
|
} else {
|
|
|
|
if (o == 1) {
|
|
|
|
o = '-';
|
|
|
|
}
|
2002-10-21 16:07:21 +00:00
|
|
|
opt[0] = o;
|
|
|
|
optname = opt;
|
|
|
|
}
|
2002-09-30 03:02:52 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
if (php_optarg != NULL) {
|
|
|
|
/* keep the arg as binary, since the encoding is not known */
|
2014-02-10 08:18:01 +00:00
|
|
|
ZVAL_STRING(&val, php_optarg);
|
2002-09-30 03:02:52 +00:00
|
|
|
} else {
|
2014-02-10 08:18:01 +00:00
|
|
|
ZVAL_FALSE(&val);
|
2002-09-30 03:02:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Add this option / argument pair to the result hash. */
|
2018-03-01 19:52:09 +00:00
|
|
|
optname_len = strlen(optname);
|
2014-08-25 17:24:55 +00:00
|
|
|
if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) {
|
2005-12-16 20:09:16 +00:00
|
|
|
/* numeric string */
|
|
|
|
int optname_int = atoi(optname);
|
2015-09-24 19:39:59 +00:00
|
|
|
if ((args = zend_hash_index_find(Z_ARRVAL_P(return_value), optname_int)) != NULL) {
|
2014-02-10 08:18:01 +00:00
|
|
|
if (Z_TYPE_P(args) != IS_ARRAY) {
|
2005-12-16 20:09:16 +00:00
|
|
|
convert_to_array_ex(args);
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2015-09-24 19:39:59 +00:00
|
|
|
zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
|
2005-12-16 20:09:16 +00:00
|
|
|
} else {
|
2015-09-24 19:39:59 +00:00
|
|
|
zend_hash_index_update(Z_ARRVAL_P(return_value), optname_int, &val);
|
2005-12-16 20:09:16 +00:00
|
|
|
}
|
2002-10-21 16:07:21 +00:00
|
|
|
} else {
|
2005-12-16 20:09:16 +00:00
|
|
|
/* other strings */
|
2015-09-24 19:39:59 +00:00
|
|
|
if ((args = zend_hash_str_find(Z_ARRVAL_P(return_value), optname, strlen(optname))) != NULL) {
|
2014-02-10 08:18:01 +00:00
|
|
|
if (Z_TYPE_P(args) != IS_ARRAY) {
|
2005-12-16 20:09:16 +00:00
|
|
|
convert_to_array_ex(args);
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2015-09-24 19:39:59 +00:00
|
|
|
zend_hash_next_index_insert(Z_ARRVAL_P(args), &val);
|
2005-12-16 20:09:16 +00:00
|
|
|
} else {
|
2015-09-24 19:39:59 +00:00
|
|
|
zend_hash_str_add(Z_ARRVAL_P(return_value), optname, strlen(optname), &val);
|
2005-12-16 20:09:16 +00:00
|
|
|
}
|
2002-09-30 03:02:52 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
|
|
|
php_optarg = NULL;
|
2002-09-30 03:02:52 +00:00
|
|
|
}
|
|
|
|
|
2016-05-29 17:44:16 +00:00
|
|
|
/* Set zoptind to php_optind */
|
|
|
|
if (zoptind) {
|
|
|
|
ZVAL_LONG(zoptind, php_optind);
|
|
|
|
}
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
free_longopts(orig_opts);
|
|
|
|
efree(orig_opts);
|
2002-09-30 03:02:52 +00:00
|
|
|
free_argv(argv, argc);
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto void flush(void)
|
|
|
|
Flush the output buffer */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(flush)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2015-03-03 10:37:47 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
sapi_flush();
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto void sleep(int seconds)
|
|
|
|
Delay for a given number of seconds */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(sleep)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long num;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_LONG(num)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
|
|
|
|
2006-02-21 15:32:06 +00:00
|
|
|
if (num < 0) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Number of seconds must be greater than or equal to 0");
|
2006-02-21 15:32:06 +00:00
|
|
|
RETURN_FALSE;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2004-11-02 17:03:20 +00:00
|
|
|
#ifdef PHP_SLEEP_NON_VOID
|
2014-10-22 15:27:33 +00:00
|
|
|
RETURN_LONG(php_sleep((unsigned int)num));
|
2004-11-03 06:22:08 +00:00
|
|
|
#else
|
2014-10-22 15:27:33 +00:00
|
|
|
php_sleep((unsigned int)num);
|
2004-11-02 17:03:20 +00:00
|
|
|
#endif
|
2004-11-03 06:22:08 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto void usleep(int micro_seconds)
|
|
|
|
Delay for a given number of micro seconds */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(usleep)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
|
|
|
#if HAVE_USLEEP
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long num;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_LONG(num)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
|
|
|
|
2006-02-16 10:13:52 +00:00
|
|
|
if (num < 0) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0");
|
2006-02-16 10:13:52 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2014-10-22 15:27:33 +00:00
|
|
|
usleep((unsigned int)num);
|
1999-04-17 00:37:12 +00:00
|
|
|
#endif
|
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2003-11-12 23:43:46 +00:00
|
|
|
#if HAVE_NANOSLEEP
|
2018-02-23 07:42:27 +00:00
|
|
|
/* {{{ proto mixed time_nanosleep(int seconds, int nanoseconds)
|
2003-11-12 22:02:37 +00:00
|
|
|
Delay for a number of seconds and nano seconds */
|
2003-11-14 22:55:54 +00:00
|
|
|
PHP_FUNCTION(time_nanosleep)
|
2003-11-12 22:02:37 +00:00
|
|
|
{
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long tv_sec, tv_nsec;
|
2003-11-12 22:02:37 +00:00
|
|
|
struct timespec php_req, php_rem;
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_LONG(tv_sec)
|
|
|
|
Z_PARAM_LONG(tv_nsec)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2003-11-12 22:02:37 +00:00
|
|
|
|
2012-03-12 16:53:07 +00:00
|
|
|
if (tv_sec < 0) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "The seconds value must be greater than 0");
|
2012-03-12 16:53:07 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
if (tv_nsec < 0) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "The nanoseconds value must be greater than 0");
|
2012-03-12 16:53:07 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2003-11-12 22:02:37 +00:00
|
|
|
php_req.tv_sec = (time_t) tv_sec;
|
2014-10-22 15:27:33 +00:00
|
|
|
php_req.tv_nsec = (long)tv_nsec;
|
2003-11-12 22:02:37 +00:00
|
|
|
if (!nanosleep(&php_req, &php_rem)) {
|
|
|
|
RETURN_TRUE;
|
|
|
|
} else if (errno == EINTR) {
|
|
|
|
array_init(return_value);
|
2015-01-16 05:52:36 +00:00
|
|
|
add_assoc_long_ex(return_value, "seconds", sizeof("seconds")-1, php_rem.tv_sec);
|
|
|
|
add_assoc_long_ex(return_value, "nanoseconds", sizeof("nanoseconds")-1, php_rem.tv_nsec);
|
2003-11-12 22:02:37 +00:00
|
|
|
return;
|
|
|
|
} else if (errno == EINVAL) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "nanoseconds was not in the range 0 to 999 999 999 or seconds was negative");
|
2003-11-12 22:02:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
/* }}} */
|
2005-04-10 16:25:11 +00:00
|
|
|
|
|
|
|
/* {{{ proto mixed time_sleep_until(float timestamp)
|
|
|
|
Make the script sleep until the specified time */
|
|
|
|
PHP_FUNCTION(time_sleep_until)
|
|
|
|
{
|
|
|
|
double d_ts, c_ts;
|
|
|
|
struct timeval tm;
|
|
|
|
struct timespec php_req, php_rem;
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_DOUBLE(d_ts)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2005-04-10 16:25:11 +00:00
|
|
|
|
|
|
|
if (gettimeofday((struct timeval *) &tm, NULL) != 0) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
c_ts = (double)(d_ts - tm.tv_sec - tm.tv_usec / 1000000.00);
|
|
|
|
if (c_ts < 0) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Sleep until to time is less than current time");
|
2005-04-10 16:25:11 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
php_req.tv_sec = (time_t) c_ts;
|
|
|
|
if (php_req.tv_sec > c_ts) { /* rounding up occurred */
|
|
|
|
php_req.tv_sec--;
|
|
|
|
}
|
|
|
|
/* 1sec = 1000000000 nanoseconds */
|
|
|
|
php_req.tv_nsec = (long) ((c_ts - php_req.tv_sec) * 1000000000.00);
|
|
|
|
|
|
|
|
while (nanosleep(&php_req, &php_rem)) {
|
|
|
|
if (errno == EINTR) {
|
|
|
|
php_req.tv_sec = php_rem.tv_sec;
|
|
|
|
php_req.tv_nsec = php_rem.tv_nsec;
|
|
|
|
} else {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RETURN_TRUE;
|
|
|
|
}
|
|
|
|
/* }}} */
|
2003-11-12 23:43:46 +00:00
|
|
|
#endif
|
2003-11-12 22:02:37 +00:00
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto string get_current_user(void)
|
|
|
|
Get the name of the owner of the current PHP script */
|
1999-11-13 20:31:54 +00:00
|
|
|
PHP_FUNCTION(get_current_user)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2008-03-10 22:15:36 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
|
|
|
return;
|
2001-08-13 07:55:39 +00:00
|
|
|
}
|
2001-08-13 06:43:47 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
RETURN_STRING(php_get_current_user());
|
1999-11-13 20:31:54 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-09-28 02:05:10 +00:00
|
|
|
/* {{{ add_config_entry_cb
|
|
|
|
*/
|
2014-12-13 22:06:14 +00:00
|
|
|
static int add_config_entry_cb(zval *entry, int num_args, va_list args, zend_hash_key *hash_key)
|
2007-09-28 02:05:10 +00:00
|
|
|
{
|
2008-08-21 16:55:45 +00:00
|
|
|
zval *retval = (zval *)va_arg(args, zval*);
|
2014-02-10 08:18:01 +00:00
|
|
|
zval tmp;
|
2007-09-28 02:05:10 +00:00
|
|
|
|
|
|
|
if (Z_TYPE_P(entry) == IS_STRING) {
|
2014-02-10 08:18:01 +00:00
|
|
|
if (hash_key->key) {
|
2015-06-30 01:05:24 +00:00
|
|
|
add_assoc_str_ex(retval, ZSTR_VAL(hash_key->key), ZSTR_LEN(hash_key->key), zend_string_copy(Z_STR_P(entry)));
|
2007-09-28 02:05:10 +00:00
|
|
|
} else {
|
2014-08-25 17:24:55 +00:00
|
|
|
add_index_str(retval, hash_key->h, zend_string_copy(Z_STR_P(entry)));
|
2007-09-28 02:05:10 +00:00
|
|
|
}
|
|
|
|
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
|
2014-02-10 08:18:01 +00:00
|
|
|
array_init(&tmp);
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_hash_apply_with_arguments(Z_ARRVAL_P(entry), add_config_entry_cb, 1, tmp);
|
2014-04-01 18:36:17 +00:00
|
|
|
zend_hash_update(Z_ARRVAL_P(retval), hash_key->key, &tmp);
|
2007-09-28 02:05:10 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ proto mixed get_cfg_var(string option_name)
|
2000-03-29 01:39:04 +00:00
|
|
|
Get the value of a PHP configuration option */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(get_cfg_var)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *varname;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t varname_len;
|
2007-10-01 12:40:54 +00:00
|
|
|
zval *retval;
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(varname, varname_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2016-11-26 14:18:42 +00:00
|
|
|
retval = cfg_get_entry(varname, (uint32_t)varname_len);
|
2007-09-28 02:05:10 +00:00
|
|
|
|
|
|
|
if (retval) {
|
|
|
|
if (Z_TYPE_P(retval) == IS_ARRAY) {
|
|
|
|
array_init(return_value);
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_hash_apply_with_arguments(Z_ARRVAL_P(retval), add_config_entry_cb, 1, return_value);
|
2007-09-28 02:05:10 +00:00
|
|
|
return;
|
|
|
|
} else {
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(Z_STRVAL_P(retval));
|
2007-09-28 02:05:10 +00:00
|
|
|
}
|
|
|
|
} else {
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ proto int get_magic_quotes_runtime(void)
|
2000-12-18 19:23:50 +00:00
|
|
|
Get the current active configuration setting of magic_quotes_runtime */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(get_magic_quotes_runtime)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2011-07-22 11:25:30 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
RETURN_FALSE;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto int get_magic_quotes_gpc(void)
|
|
|
|
Get the current active configuration setting of magic_quotes_gpc */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(get_magic_quotes_gpc)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2011-07-22 11:25:30 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
RETURN_FALSE;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-12-18 19:23:50 +00:00
|
|
|
/*
|
1999-04-17 00:37:12 +00:00
|
|
|
1st arg = error message
|
|
|
|
2nd arg = error option
|
|
|
|
3rd arg = optional parameters (email address or tcp address)
|
|
|
|
4th arg = used for additional headers if email
|
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
error options:
|
2007-10-01 12:40:54 +00:00
|
|
|
0 = send to php_error_log (uses syslog or file depending on ini setting)
|
1999-04-17 00:37:12 +00:00
|
|
|
1 = send via email to 3rd parameter 4th option = additional headers
|
|
|
|
2 = send via tcp/ip to 3rd parameter (name or ip:port)
|
|
|
|
3 = save to file in 3rd parameter
|
2008-11-13 18:48:25 +00:00
|
|
|
4 = send to SAPI logger directly
|
1999-04-17 00:37:12 +00:00
|
|
|
*/
|
|
|
|
|
2002-08-26 23:16:51 +00:00
|
|
|
/* {{{ proto bool error_log(string message [, int message_type [, string destination [, string extra_headers]]])
|
2000-03-29 01:39:04 +00:00
|
|
|
Send an error message somewhere */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(error_log)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2001-08-29 16:00:30 +00:00
|
|
|
char *message, *opt = NULL, *headers = NULL;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t message_len, opt_len = 0, headers_len = 0;
|
2008-07-23 19:34:35 +00:00
|
|
|
int opt_err = 0, argc = ZEND_NUM_ARGS();
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long erropt = 0;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 4)
|
|
|
|
Z_PARAM_STRING(message, message_len)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_LONG(erropt)
|
|
|
|
Z_PARAM_PATH(opt, opt_len)
|
|
|
|
Z_PARAM_STRING(headers, headers_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2008-07-23 19:34:35 +00:00
|
|
|
if (argc > 1) {
|
2014-10-22 15:27:33 +00:00
|
|
|
opt_err = (int)erropt;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (_php_error_log_ex(opt_err, message, message_len, opt, headers) == FAILURE) {
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2007-11-02 19:40:39 +00:00
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_TRUE;
|
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2009-11-22 18:31:01 +00:00
|
|
|
/* For BC (not binary-safe!) */
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers) /* {{{ */
|
2001-02-05 21:59:17 +00:00
|
|
|
{
|
2014-12-13 22:06:14 +00:00
|
|
|
return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers);
|
2009-11-22 18:31:01 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers) /* {{{ */
|
2009-11-22 18:31:01 +00:00
|
|
|
{
|
|
|
|
php_stream *stream = NULL;
|
2017-03-09 19:27:01 +00:00
|
|
|
size_t nbytes;
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2009-11-22 18:31:01 +00:00
|
|
|
switch (opt_err)
|
|
|
|
{
|
2001-08-29 16:00:30 +00:00
|
|
|
case 1: /*send an email */
|
2014-12-13 22:06:14 +00:00
|
|
|
if (!php_mail(opt, "PHP error_log message", message, headers, NULL)) {
|
2009-11-22 18:31:01 +00:00
|
|
|
return FAILURE;
|
2001-02-05 21:59:17 +00:00
|
|
|
}
|
|
|
|
break;
|
2001-08-29 16:00:30 +00:00
|
|
|
|
|
|
|
case 2: /*send to an address */
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "TCP/IP option not available!");
|
1999-04-17 00:37:12 +00:00
|
|
|
return FAILURE;
|
2001-02-05 21:59:17 +00:00
|
|
|
break;
|
2001-08-29 16:00:30 +00:00
|
|
|
|
|
|
|
case 3: /*save to a file */
|
2010-04-26 23:53:30 +00:00
|
|
|
stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | REPORT_ERRORS, NULL);
|
2009-11-22 18:31:01 +00:00
|
|
|
if (!stream) {
|
2001-02-05 21:59:17 +00:00
|
|
|
return FAILURE;
|
2009-11-22 18:31:01 +00:00
|
|
|
}
|
2017-03-09 19:27:01 +00:00
|
|
|
nbytes = php_stream_write(stream, message, message_len);
|
2002-03-15 21:03:08 +00:00
|
|
|
php_stream_close(stream);
|
2017-03-09 19:27:01 +00:00
|
|
|
if (nbytes != message_len) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
2001-02-05 21:59:17 +00:00
|
|
|
break;
|
2009-11-22 18:31:01 +00:00
|
|
|
|
2008-11-13 18:48:25 +00:00
|
|
|
case 4: /* send to SAPI */
|
|
|
|
if (sapi_module.log_message) {
|
2016-07-04 08:46:44 +00:00
|
|
|
sapi_module.log_message(message, -1);
|
2008-11-13 18:48:25 +00:00
|
|
|
} else {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
break;
|
2009-11-22 18:31:01 +00:00
|
|
|
|
2001-02-05 21:59:17 +00:00
|
|
|
default:
|
2016-04-06 11:14:41 +00:00
|
|
|
php_log_err_with_severity(message, LOG_NOTICE);
|
2001-02-05 21:59:17 +00:00
|
|
|
break;
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2006-07-19 12:25:46 +00:00
|
|
|
/* {{{ proto array error_get_last()
|
2007-10-01 12:40:54 +00:00
|
|
|
Get the last occurred error as associative array. Returns NULL if there hasn't been an error yet. */
|
2006-07-19 12:25:46 +00:00
|
|
|
PHP_FUNCTION(error_get_last)
|
|
|
|
{
|
2015-03-03 10:49:49 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
2007-10-01 12:40:54 +00:00
|
|
|
return;
|
2006-07-19 12:25:46 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2006-07-19 12:25:46 +00:00
|
|
|
if (PG(last_error_message)) {
|
|
|
|
array_init(return_value);
|
2014-08-25 17:24:55 +00:00
|
|
|
add_assoc_long_ex(return_value, "type", sizeof("type")-1, PG(last_error_type));
|
2014-04-15 11:40:40 +00:00
|
|
|
add_assoc_string_ex(return_value, "message", sizeof("message")-1, PG(last_error_message));
|
|
|
|
add_assoc_string_ex(return_value, "file", sizeof("file")-1, PG(last_error_file)?PG(last_error_file):"-");
|
2014-08-25 17:24:55 +00:00
|
|
|
add_assoc_long_ex(return_value, "line", sizeof("line")-1, PG(last_error_lineno));
|
2006-07-19 12:25:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2015-03-03 11:13:51 +00:00
|
|
|
/* {{{ proto void error_clear_last(void)
|
|
|
|
Clear the last occurred error. */
|
2015-03-03 09:48:03 +00:00
|
|
|
PHP_FUNCTION(error_clear_last)
|
|
|
|
{
|
2015-03-03 10:49:49 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
2015-03-03 09:48:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (PG(last_error_message)) {
|
|
|
|
PG(last_error_type) = 0;
|
|
|
|
PG(last_error_lineno) = 0;
|
|
|
|
|
2015-05-13 06:43:05 +00:00
|
|
|
free(PG(last_error_message));
|
2015-03-03 09:48:03 +00:00
|
|
|
PG(last_error_message) = NULL;
|
|
|
|
|
|
|
|
if (PG(last_error_file)) {
|
2015-05-13 06:43:05 +00:00
|
|
|
free(PG(last_error_file));
|
2015-03-03 09:48:03 +00:00
|
|
|
PG(last_error_file) = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2007-11-02 19:40:39 +00:00
|
|
|
/* {{{ proto mixed call_user_func(mixed function_name [, mixed parmeter] [, mixed ...])
|
2014-08-28 19:53:32 +00:00
|
|
|
Call a user function which is the first parameter
|
|
|
|
Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
|
1999-05-16 11:19:26 +00:00
|
|
|
PHP_FUNCTION(call_user_func)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval retval;
|
2007-11-02 19:40:39 +00:00
|
|
|
zend_fcall_info fci;
|
|
|
|
zend_fcall_info_cache fci_cache;
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2014-07-11 12:32:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, -1)
|
|
|
|
Z_PARAM_FUNC(fci, fci_cache)
|
|
|
|
Z_PARAM_VARIADIC('*', fci.params, fci.param_count)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2001-03-09 21:42:26 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
fci.retval = &retval;
|
2001-05-14 20:06:06 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
|
2016-09-30 20:08:08 +00:00
|
|
|
if (Z_ISREF(retval)) {
|
|
|
|
zend_unwrap_reference(&retval);
|
|
|
|
}
|
2014-04-15 11:40:40 +00:00
|
|
|
ZVAL_COPY_VALUE(return_value, &retval);
|
2005-11-16 09:31:21 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-11-24 21:05:25 +00:00
|
|
|
/* {{{ proto mixed call_user_func_array(string function_name, array parameters)
|
2014-08-28 19:53:32 +00:00
|
|
|
Call a user function which is the first parameter with the arguments contained in array
|
|
|
|
Warning: This function is special-cased by zend_compile.c and so is usually bypassed */
|
2000-11-24 21:05:25 +00:00
|
|
|
PHP_FUNCTION(call_user_func_array)
|
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *params, retval;
|
2007-11-02 19:40:39 +00:00
|
|
|
zend_fcall_info fci;
|
|
|
|
zend_fcall_info_cache fci_cache;
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2014-07-11 12:32:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_FUNC(fci, fci_cache)
|
2018-01-17 11:11:40 +00:00
|
|
|
Z_PARAM_ARRAY(params)
|
2014-07-11 12:32:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2000-12-07 14:54:52 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_fcall_info_args(&fci, params);
|
2014-02-10 08:18:01 +00:00
|
|
|
fci.retval = &retval;
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
|
2016-09-30 20:08:08 +00:00
|
|
|
if (Z_ISREF(retval)) {
|
|
|
|
zend_unwrap_reference(&retval);
|
|
|
|
}
|
2014-04-15 11:40:40 +00:00
|
|
|
ZVAL_COPY_VALUE(return_value, &retval);
|
2001-05-14 20:06:06 +00:00
|
|
|
}
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2007-11-02 19:40:39 +00:00
|
|
|
zend_fcall_info_args_clear(&fci, 1);
|
2000-11-24 21:05:25 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2008-04-07 10:44:59 +00:00
|
|
|
/* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U
|
|
|
|
Call a user function which is the first parameter */
|
|
|
|
PHP_FUNCTION(forward_static_call)
|
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval retval;
|
2008-04-07 10:44:59 +00:00
|
|
|
zend_fcall_info fci;
|
|
|
|
zend_fcall_info_cache fci_cache;
|
2015-04-23 09:16:37 +00:00
|
|
|
zend_class_entry *called_scope;
|
2008-04-07 10:44:59 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, -1)
|
|
|
|
Z_PARAM_FUNC(fci, fci_cache)
|
|
|
|
Z_PARAM_VARIADIC('*', fci.params, fci.param_count)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2008-04-07 10:44:59 +00:00
|
|
|
|
2014-10-03 15:32:46 +00:00
|
|
|
if (!EX(prev_execute_data)->func->common.scope) {
|
2016-06-11 17:07:28 +00:00
|
|
|
zend_throw_error(NULL, "Cannot call forward_static_call() when no class scope is active");
|
|
|
|
return;
|
2008-04-07 10:44:59 +00:00
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
fci.retval = &retval;
|
2008-04-07 10:44:59 +00:00
|
|
|
|
2015-04-23 09:16:37 +00:00
|
|
|
called_scope = zend_get_called_scope(execute_data);
|
2016-01-25 04:13:22 +00:00
|
|
|
if (called_scope && fci_cache.calling_scope &&
|
2015-04-23 09:16:37 +00:00
|
|
|
instanceof_function(called_scope, fci_cache.calling_scope)) {
|
|
|
|
fci_cache.called_scope = called_scope;
|
2008-04-07 10:44:59 +00:00
|
|
|
}
|
2015-01-03 09:22:58 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
|
2016-09-30 20:08:08 +00:00
|
|
|
if (Z_ISREF(retval)) {
|
|
|
|
zend_unwrap_reference(&retval);
|
|
|
|
}
|
2014-04-15 11:40:40 +00:00
|
|
|
ZVAL_COPY_VALUE(return_value, &retval);
|
2008-04-07 10:44:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ proto mixed call_user_func_array(string function_name, array parameters) U
|
|
|
|
Call a user function which is the first parameter with the arguments contained in array */
|
|
|
|
PHP_FUNCTION(forward_static_call_array)
|
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *params, retval;
|
2008-04-07 10:44:59 +00:00
|
|
|
zend_fcall_info fci;
|
|
|
|
zend_fcall_info_cache fci_cache;
|
2015-04-23 09:16:37 +00:00
|
|
|
zend_class_entry *called_scope;
|
2008-04-07 10:44:59 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_FUNC(fci, fci_cache)
|
2018-01-17 11:11:40 +00:00
|
|
|
Z_PARAM_ARRAY(params)
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2008-04-07 10:44:59 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_fcall_info_args(&fci, params);
|
2014-02-10 08:18:01 +00:00
|
|
|
fci.retval = &retval;
|
2008-04-07 10:44:59 +00:00
|
|
|
|
2015-04-23 09:16:37 +00:00
|
|
|
called_scope = zend_get_called_scope(execute_data);
|
2016-01-25 04:13:22 +00:00
|
|
|
if (called_scope && fci_cache.calling_scope &&
|
2015-04-23 09:16:37 +00:00
|
|
|
instanceof_function(called_scope, fci_cache.calling_scope)) {
|
|
|
|
fci_cache.called_scope = called_scope;
|
2008-04-07 10:44:59 +00:00
|
|
|
}
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
|
2016-09-30 20:08:08 +00:00
|
|
|
if (Z_ISREF(retval)) {
|
|
|
|
zend_unwrap_reference(&retval);
|
|
|
|
}
|
2014-04-15 11:40:40 +00:00
|
|
|
ZVAL_COPY_VALUE(return_value, &retval);
|
2008-04-07 10:44:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zend_fcall_info_args_clear(&fci, 1);
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
void user_shutdown_function_dtor(zval *zv) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
1999-08-06 15:25:11 +00:00
|
|
|
int i;
|
2014-02-10 08:18:01 +00:00
|
|
|
php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
for (i = 0; i < shutdown_function_entry->arg_count; i++) {
|
1999-08-06 15:25:11 +00:00
|
|
|
zval_ptr_dtor(&shutdown_function_entry->arguments[i]);
|
|
|
|
}
|
|
|
|
efree(shutdown_function_entry->arguments);
|
2014-02-21 19:51:08 +00:00
|
|
|
efree(shutdown_function_entry);
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
void user_tick_function_dtor(user_tick_function_entry *tick_function_entry) /* {{{ */
|
2000-09-01 16:10:17 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < tick_function_entry->arg_count; i++) {
|
|
|
|
zval_ptr_dtor(&tick_function_entry->arguments[i]);
|
|
|
|
}
|
|
|
|
efree(tick_function_entry->arguments);
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2000-02-13 00:26:54 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
static int user_shutdown_function_call(zval *zv) /* {{{ */
|
2000-02-11 21:14:42 +00:00
|
|
|
{
|
2014-02-21 19:51:08 +00:00
|
|
|
php_shutdown_function_entry *shutdown_function_entry = Z_PTR_P(zv);
|
2000-02-11 21:14:42 +00:00
|
|
|
zval retval;
|
2005-04-21 14:44:29 +00:00
|
|
|
|
2017-06-25 16:45:59 +00:00
|
|
|
if (!zend_is_callable(&shutdown_function_entry->arguments[0], 0, NULL)) {
|
|
|
|
zend_string *function_name
|
|
|
|
= zend_get_callable_name(&shutdown_function_entry->arguments[0]);
|
|
|
|
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %s() - function does not exist", ZSTR_VAL(function_name));
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(function_name, 0);
|
2017-06-25 16:45:59 +00:00
|
|
|
return 0;
|
2007-11-02 19:40:39 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2006-09-15 09:12:17 +00:00
|
|
|
if (call_user_function(EG(function_table), NULL,
|
2014-02-10 08:18:01 +00:00
|
|
|
&shutdown_function_entry->arguments[0],
|
2007-10-01 12:40:54 +00:00
|
|
|
&retval,
|
2006-09-15 09:12:17 +00:00
|
|
|
shutdown_function_entry->arg_count - 1,
|
2014-12-14 13:07:59 +00:00
|
|
|
shutdown_function_entry->arguments + 1) == SUCCESS)
|
2005-04-21 14:44:29 +00:00
|
|
|
{
|
2018-07-05 11:09:47 +00:00
|
|
|
zval_ptr_dtor(&retval);
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2000-02-11 21:14:42 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
static void user_tick_function_call(user_tick_function_entry *tick_fe) /* {{{ */
|
2000-09-01 16:10:17 +00:00
|
|
|
{
|
|
|
|
zval retval;
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *function = &tick_fe->arguments[0];
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2002-07-16 14:14:22 +00:00
|
|
|
/* Prevent reentrant calls to the same user ticks function */
|
|
|
|
if (! tick_fe->calling) {
|
|
|
|
tick_fe->calling = 1;
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
if (call_user_function( EG(function_table), NULL,
|
|
|
|
function,
|
2002-07-16 14:14:22 +00:00
|
|
|
&retval,
|
|
|
|
tick_fe->arg_count - 1,
|
2007-10-01 12:40:54 +00:00
|
|
|
tick_fe->arguments + 1
|
2014-12-14 13:07:59 +00:00
|
|
|
) == SUCCESS) {
|
2018-07-05 11:09:47 +00:00
|
|
|
zval_ptr_dtor(&retval);
|
2000-09-01 16:10:17 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
} else {
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *obj, *method;
|
2002-07-16 14:14:22 +00:00
|
|
|
|
|
|
|
if (Z_TYPE_P(function) == IS_STRING) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Unable to call %s() - function does not exist", Z_STRVAL_P(function));
|
2007-10-01 12:40:54 +00:00
|
|
|
} else if ( Z_TYPE_P(function) == IS_ARRAY
|
2014-02-10 08:18:01 +00:00
|
|
|
&& (obj = zend_hash_index_find(Z_ARRVAL_P(function), 0)) != NULL
|
|
|
|
&& (method = zend_hash_index_find(Z_ARRVAL_P(function), 1)) != NULL
|
|
|
|
&& Z_TYPE_P(obj) == IS_OBJECT
|
|
|
|
&& Z_TYPE_P(method) == IS_STRING) {
|
2015-06-30 01:05:24 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Unable to call %s::%s() - function does not exist", ZSTR_VAL(Z_OBJCE_P(obj)->name), Z_STRVAL_P(method));
|
2002-07-16 14:14:22 +00:00
|
|
|
} else {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Unable to call tick function");
|
2002-07-16 14:14:22 +00:00
|
|
|
}
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
2007-11-02 19:40:39 +00:00
|
|
|
|
2002-07-16 14:14:22 +00:00
|
|
|
tick_fe->calling = 0;
|
2000-09-01 16:10:17 +00:00
|
|
|
}
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2000-09-01 16:10:17 +00:00
|
|
|
|
2015-09-28 09:21:17 +00:00
|
|
|
static void run_user_tick_functions(int tick_count, void *arg) /* {{{ */
|
2000-09-01 16:10:17 +00:00
|
|
|
{
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_llist_apply(BG(user_tick_functions), (llist_apply_func_t) user_tick_function_call);
|
2000-09-01 16:10:17 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2000-09-01 16:10:17 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_tick_function_entry * tick_fe2) /* {{{ */
|
2000-09-01 16:10:17 +00:00
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *func1 = &tick_fe1->arguments[0];
|
|
|
|
zval *func2 = &tick_fe2->arguments[0];
|
2007-04-10 09:37:09 +00:00
|
|
|
int ret;
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2000-09-01 16:10:17 +00:00
|
|
|
if (Z_TYPE_P(func1) == IS_STRING && Z_TYPE_P(func2) == IS_STRING) {
|
2014-12-22 04:16:25 +00:00
|
|
|
ret = zend_binary_zval_strcmp(func1, func2) == 0;
|
2000-09-01 16:10:17 +00:00
|
|
|
} else if (Z_TYPE_P(func1) == IS_ARRAY && Z_TYPE_P(func2) == IS_ARRAY) {
|
2014-12-22 04:16:25 +00:00
|
|
|
ret = zend_compare_arrays(func1, func2) == 0;
|
2008-07-17 09:53:42 +00:00
|
|
|
} else if (Z_TYPE_P(func1) == IS_OBJECT && Z_TYPE_P(func2) == IS_OBJECT) {
|
2014-12-22 04:16:25 +00:00
|
|
|
ret = zend_compare_objects(func1, func2) == 0;
|
2001-08-29 16:00:30 +00:00
|
|
|
} else {
|
2007-04-10 09:37:09 +00:00
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ret && tick_fe1->calling) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Unable to delete tick function executed at the moment");
|
2000-09-01 16:10:17 +00:00
|
|
|
return 0;
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
2007-04-10 09:37:09 +00:00
|
|
|
return ret;
|
2000-09-01 16:10:17 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2000-02-13 00:26:54 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI void php_call_shutdown_functions(void) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2006-05-19 06:09:15 +00:00
|
|
|
if (BG(user_shutdown_function_names)) {
|
2001-08-29 16:00:30 +00:00
|
|
|
zend_try {
|
2015-11-11 04:06:38 +00:00
|
|
|
zend_hash_apply(BG(user_shutdown_function_names), user_shutdown_function_call);
|
|
|
|
}
|
|
|
|
zend_end_try();
|
2006-05-19 06:09:15 +00:00
|
|
|
}
|
2005-01-09 16:30:09 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2005-01-09 16:30:09 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI void php_free_shutdown_functions(void) /* {{{ */
|
2005-01-09 16:30:09 +00:00
|
|
|
{
|
|
|
|
if (BG(user_shutdown_function_names))
|
|
|
|
zend_try {
|
2001-08-29 16:00:30 +00:00
|
|
|
zend_hash_destroy(BG(user_shutdown_function_names));
|
2004-05-26 18:00:27 +00:00
|
|
|
FREE_HASHTABLE(BG(user_shutdown_function_names));
|
2005-01-08 20:44:23 +00:00
|
|
|
BG(user_shutdown_function_names) = NULL;
|
2012-08-12 12:58:09 +00:00
|
|
|
} zend_catch {
|
|
|
|
/* maybe shutdown method call exit, we just ignore it */
|
|
|
|
FREE_HASHTABLE(BG(user_shutdown_function_names));
|
|
|
|
BG(user_shutdown_function_names) = NULL;
|
|
|
|
} zend_end_try();
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2011-06-20 07:11:21 +00:00
|
|
|
/* {{{ proto void register_shutdown_function(callback function) U
|
1999-04-17 00:37:12 +00:00
|
|
|
Register a user-level function to be called on request termination */
|
|
|
|
PHP_FUNCTION(register_shutdown_function)
|
|
|
|
{
|
1999-08-06 15:25:11 +00:00
|
|
|
php_shutdown_function_entry shutdown_function_entry;
|
|
|
|
int i;
|
|
|
|
|
2000-06-05 19:47:54 +00:00
|
|
|
shutdown_function_entry.arg_count = ZEND_NUM_ARGS();
|
1999-08-06 15:25:11 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
if (shutdown_function_entry.arg_count < 1) {
|
1999-04-17 00:37:12 +00:00
|
|
|
WRONG_PARAM_COUNT;
|
|
|
|
}
|
1999-08-06 15:25:11 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
shutdown_function_entry.arguments = (zval *) safe_emalloc(sizeof(zval), shutdown_function_entry.arg_count, 0);
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_get_parameters_array(ZEND_NUM_ARGS(), shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) {
|
2006-04-03 13:46:11 +00:00
|
|
|
efree(shutdown_function_entry.arguments);
|
1999-08-06 15:25:11 +00:00
|
|
|
RETURN_FALSE;
|
2000-06-03 04:16:46 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2005-04-21 14:44:29 +00:00
|
|
|
/* Prevent entering of anything but valid callback (syntax check only!) */
|
2017-06-25 16:45:59 +00:00
|
|
|
if (!zend_is_callable(&shutdown_function_entry.arguments[0], 0, NULL)) {
|
|
|
|
zend_string *callback_name
|
|
|
|
= zend_get_callable_name(&shutdown_function_entry.arguments[0]);
|
|
|
|
php_error_docref(NULL, E_WARNING, "Invalid shutdown callback '%s' passed", ZSTR_VAL(callback_name));
|
2005-04-21 14:44:29 +00:00
|
|
|
efree(shutdown_function_entry.arguments);
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(callback_name, 0);
|
2005-04-21 14:44:29 +00:00
|
|
|
RETVAL_FALSE;
|
|
|
|
} else {
|
|
|
|
if (!BG(user_shutdown_function_names)) {
|
|
|
|
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0);
|
2005-04-21 14:44:29 +00:00
|
|
|
}
|
1999-08-06 15:25:11 +00:00
|
|
|
|
2005-04-21 14:44:29 +00:00
|
|
|
for (i = 0; i < shutdown_function_entry.arg_count; i++) {
|
2017-11-01 02:25:10 +00:00
|
|
|
Z_TRY_ADDREF(shutdown_function_entry.arguments[i]);
|
2005-04-21 14:44:29 +00:00
|
|
|
}
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry));
|
2005-04-21 14:44:29 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry) /* {{{ */
|
2011-09-13 22:28:15 +00:00
|
|
|
{
|
|
|
|
if (!BG(user_shutdown_function_names)) {
|
|
|
|
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0);
|
2011-09-13 22:28:15 +00:00
|
|
|
}
|
|
|
|
|
2018-06-01 08:58:57 +00:00
|
|
|
zend_hash_str_update_mem(BG(user_shutdown_function_names), function_name, function_len, shutdown_function_entry, sizeof(php_shutdown_function_entry));
|
|
|
|
return 1;
|
2011-09-13 22:28:15 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI zend_bool remove_user_shutdown_function(char *function_name, size_t function_len) /* {{{ */
|
2011-09-13 22:28:15 +00:00
|
|
|
{
|
|
|
|
if (BG(user_shutdown_function_names)) {
|
2014-02-10 08:18:01 +00:00
|
|
|
return zend_hash_str_del(BG(user_shutdown_function_names), function_name, function_len) != FAILURE;
|
2011-09-13 22:28:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry) /* {{{ */
|
2011-09-13 22:28:15 +00:00
|
|
|
{
|
|
|
|
if (!BG(user_shutdown_function_names)) {
|
|
|
|
ALLOC_HASHTABLE(BG(user_shutdown_function_names));
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_hash_init(BG(user_shutdown_function_names), 0, NULL, user_shutdown_function_dtor, 0);
|
2011-09-13 22:28:15 +00:00
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
return zend_hash_next_index_insert_mem(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry)) != NULL;
|
2011-09-13 22:28:15 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini) /* {{{ */
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
1999-05-09 18:40:59 +00:00
|
|
|
syntax_highlighter_ini->highlight_comment = INI_STR("highlight.comment");
|
|
|
|
syntax_highlighter_ini->highlight_default = INI_STR("highlight.default");
|
2001-08-29 16:00:30 +00:00
|
|
|
syntax_highlighter_ini->highlight_html = INI_STR("highlight.html");
|
1999-05-09 18:40:59 +00:00
|
|
|
syntax_highlighter_ini->highlight_keyword = INI_STR("highlight.keyword");
|
2001-08-29 16:00:30 +00:00
|
|
|
syntax_highlighter_ini->highlight_string = INI_STR("highlight.string");
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2002-02-28 16:00:26 +00:00
|
|
|
/* {{{ proto bool highlight_file(string file_name [, bool return] )
|
1999-04-17 00:37:12 +00:00
|
|
|
Syntax highlight a source file */
|
|
|
|
PHP_FUNCTION(highlight_file)
|
|
|
|
{
|
2006-08-31 14:41:24 +00:00
|
|
|
char *filename;
|
2016-06-23 09:47:06 +00:00
|
|
|
size_t filename_len;
|
|
|
|
int ret;
|
1999-04-17 00:37:12 +00:00
|
|
|
zend_syntax_highlighter_ini syntax_highlighter_ini;
|
2002-02-28 16:00:26 +00:00
|
|
|
zend_bool i = 0;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 2)
|
|
|
|
Z_PARAM_PATH(filename, filename_len)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_BOOL(i)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2002-01-25 11:27:47 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (php_check_open_basedir(filename)) {
|
2002-05-11 18:35:59 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2002-01-25 11:27:47 +00:00
|
|
|
if (i) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_start_default();
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
php_get_highlight_struct(&syntax_highlighter_ini);
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
ret = highlight_file(filename, &syntax_highlighter_ini);
|
2010-03-12 10:28:59 +00:00
|
|
|
|
2010-05-31 10:29:43 +00:00
|
|
|
if (ret == FAILURE) {
|
|
|
|
if (i) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_end();
|
2007-05-10 16:28:11 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2002-01-25 11:27:47 +00:00
|
|
|
|
|
|
|
if (i) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_get_contents(return_value);
|
|
|
|
php_output_discard();
|
2002-01-25 11:27:47 +00:00
|
|
|
} else {
|
|
|
|
RETURN_TRUE;
|
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2003-11-24 01:17:27 +00:00
|
|
|
/* {{{ proto string php_strip_whitespace(string file_name)
|
|
|
|
Return source with stripped comments and whitespace */
|
|
|
|
PHP_FUNCTION(php_strip_whitespace)
|
|
|
|
{
|
|
|
|
char *filename;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t filename_len;
|
2003-11-24 01:17:27 +00:00
|
|
|
zend_lex_state original_lex_state;
|
2016-06-23 09:47:06 +00:00
|
|
|
zend_file_handle file_handle;
|
2003-11-24 01:17:27 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_PATH(filename, filename_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2003-11-24 01:17:27 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_start_default();
|
2010-05-31 10:29:43 +00:00
|
|
|
|
2016-06-23 09:47:06 +00:00
|
|
|
memset(&file_handle, 0, sizeof(file_handle));
|
2003-11-24 01:17:27 +00:00
|
|
|
file_handle.type = ZEND_HANDLE_FILENAME;
|
|
|
|
file_handle.filename = filename;
|
|
|
|
file_handle.free_filename = 0;
|
|
|
|
file_handle.opened_path = NULL;
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_save_lexical_state(&original_lex_state);
|
|
|
|
if (open_file_for_scanning(&file_handle) == FAILURE) {
|
|
|
|
zend_restore_lexical_state(&original_lex_state);
|
|
|
|
php_output_end();
|
2003-11-24 01:17:27 +00:00
|
|
|
RETURN_EMPTY_STRING();
|
|
|
|
}
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_strip();
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_destroy_file_handle(&file_handle);
|
|
|
|
zend_restore_lexical_state(&original_lex_state);
|
2003-11-24 01:17:27 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_get_contents(return_value);
|
|
|
|
php_output_discard();
|
2003-11-24 01:17:27 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2002-02-28 16:00:26 +00:00
|
|
|
/* {{{ proto bool highlight_string(string string [, bool return] )
|
2002-01-25 11:27:47 +00:00
|
|
|
Syntax highlight a string or optionally return it */
|
1999-04-17 00:37:12 +00:00
|
|
|
PHP_FUNCTION(highlight_string)
|
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval *expr;
|
1999-04-17 00:37:12 +00:00
|
|
|
zend_syntax_highlighter_ini syntax_highlighter_ini;
|
2000-09-12 20:48:33 +00:00
|
|
|
char *hicompiled_string_description;
|
2007-11-02 19:40:39 +00:00
|
|
|
zend_bool i = 0;
|
2003-11-24 01:17:27 +00:00
|
|
|
int old_error_reporting = EG(error_reporting);
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 2)
|
2017-06-19 09:55:59 +00:00
|
|
|
Z_PARAM_ZVAL(expr)
|
2016-12-31 00:06:20 +00:00
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_BOOL(i)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2006-08-31 14:41:24 +00:00
|
|
|
convert_to_string_ex(expr);
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2002-01-25 11:27:47 +00:00
|
|
|
if (i) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_start_default();
|
2002-01-25 11:27:47 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2003-11-24 01:17:27 +00:00
|
|
|
EG(error_reporting) = E_ERROR;
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
php_get_highlight_struct(&syntax_highlighter_ini);
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
hicompiled_string_description = zend_make_compiled_string_description("highlighted code");
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description) == FAILURE) {
|
2000-09-12 20:48:33 +00:00
|
|
|
efree(hicompiled_string_description);
|
2007-05-10 16:28:11 +00:00
|
|
|
EG(error_reporting) = old_error_reporting;
|
|
|
|
if (i) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_end();
|
2007-05-10 16:28:11 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2000-09-12 20:48:33 +00:00
|
|
|
efree(hicompiled_string_description);
|
2002-01-25 11:27:47 +00:00
|
|
|
|
2003-11-24 01:17:27 +00:00
|
|
|
EG(error_reporting) = old_error_reporting;
|
|
|
|
|
2002-01-25 11:27:47 +00:00
|
|
|
if (i) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_output_get_contents(return_value);
|
|
|
|
php_output_discard();
|
2002-01-25 11:27:47 +00:00
|
|
|
} else {
|
|
|
|
RETURN_TRUE;
|
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto string ini_get(string varname)
|
|
|
|
Get a configuration option */
|
1999-04-17 00:37:12 +00:00
|
|
|
PHP_FUNCTION(ini_get)
|
|
|
|
{
|
2017-12-11 15:18:30 +00:00
|
|
|
zend_string *varname, *val;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
2017-12-11 15:18:30 +00:00
|
|
|
Z_PARAM_STR(varname)
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2017-12-11 15:18:30 +00:00
|
|
|
val = zend_ini_get_value(varname);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2017-12-11 15:18:30 +00:00
|
|
|
if (!val) {
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2017-12-11 15:18:30 +00:00
|
|
|
if (ZSTR_IS_INTERNED(val)) {
|
|
|
|
RETVAL_INTERNED_STR(val);
|
|
|
|
} else if (ZSTR_LEN(val) == 0) {
|
|
|
|
RETVAL_EMPTY_STRING();
|
|
|
|
} else if (ZSTR_LEN(val) == 1) {
|
|
|
|
RETVAL_INTERNED_STR(ZSTR_CHAR((zend_uchar)ZSTR_VAL(val)[0]));
|
|
|
|
} else if (!(GC_FLAGS(val) & GC_PERSISTENT)) {
|
|
|
|
ZVAL_NEW_STR(return_value, zend_string_copy(val));
|
|
|
|
} else {
|
|
|
|
ZVAL_NEW_STR(return_value, zend_string_init(ZSTR_VAL(val), ZSTR_LEN(val), 0));
|
2017-05-18 14:59:59 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
static int php_ini_get_option(zval *zv, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
|
2001-08-30 17:47:04 +00:00
|
|
|
{
|
2014-02-28 13:47:00 +00:00
|
|
|
zend_ini_entry *ini_entry = Z_PTR_P(zv);
|
2001-08-30 17:47:04 +00:00
|
|
|
zval *ini_array = va_arg(args, zval *);
|
|
|
|
int module_number = va_arg(args, int);
|
2008-04-14 15:32:42 +00:00
|
|
|
int details = va_arg(args, int);
|
2014-02-10 08:18:01 +00:00
|
|
|
zval option;
|
2001-08-30 17:47:04 +00:00
|
|
|
|
2002-10-03 10:42:57 +00:00
|
|
|
if (module_number != 0 && ini_entry->module_number != module_number) {
|
2001-08-30 17:47:04 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (hash_key->key == NULL ||
|
2015-06-30 01:05:24 +00:00
|
|
|
ZSTR_VAL(hash_key->key)[0] != 0
|
2007-10-01 12:40:54 +00:00
|
|
|
) {
|
2008-04-14 15:32:42 +00:00
|
|
|
if (details) {
|
2014-02-10 08:18:01 +00:00
|
|
|
array_init(&option);
|
2008-04-14 15:32:42 +00:00
|
|
|
|
|
|
|
if (ini_entry->orig_value) {
|
2014-09-02 05:52:23 +00:00
|
|
|
add_assoc_str(&option, "global_value", zend_string_copy(ini_entry->orig_value));
|
2008-04-14 15:32:42 +00:00
|
|
|
} else if (ini_entry->value) {
|
2014-09-02 05:52:23 +00:00
|
|
|
add_assoc_str(&option, "global_value", zend_string_copy(ini_entry->value));
|
2008-04-14 15:32:42 +00:00
|
|
|
} else {
|
2014-02-10 08:18:01 +00:00
|
|
|
add_assoc_null(&option, "global_value");
|
2008-04-14 15:32:42 +00:00
|
|
|
}
|
2001-08-30 17:47:04 +00:00
|
|
|
|
2008-04-14 15:32:42 +00:00
|
|
|
if (ini_entry->value) {
|
2014-09-02 05:52:23 +00:00
|
|
|
add_assoc_str(&option, "local_value", zend_string_copy(ini_entry->value));
|
2008-04-14 15:32:42 +00:00
|
|
|
} else {
|
2014-02-10 08:18:01 +00:00
|
|
|
add_assoc_null(&option, "local_value");
|
2008-04-14 15:32:42 +00:00
|
|
|
}
|
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
add_assoc_long(&option, "access", ini_entry->modifiable);
|
2001-08-30 17:47:04 +00:00
|
|
|
|
2014-09-01 16:57:33 +00:00
|
|
|
zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &option);
|
2001-08-30 17:47:04 +00:00
|
|
|
} else {
|
2008-04-14 15:32:42 +00:00
|
|
|
if (ini_entry->value) {
|
2014-09-01 16:57:33 +00:00
|
|
|
zval zv;
|
|
|
|
|
2014-09-19 13:32:50 +00:00
|
|
|
ZVAL_STR_COPY(&zv, ini_entry->value);
|
2014-09-01 16:57:33 +00:00
|
|
|
zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &zv);
|
2008-04-14 15:32:42 +00:00
|
|
|
} else {
|
2014-09-01 16:57:33 +00:00
|
|
|
zend_symtable_update(Z_ARRVAL_P(ini_array), ini_entry->name, &EG(uninitialized_zval));
|
2008-04-14 15:32:42 +00:00
|
|
|
}
|
2001-08-30 17:47:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2001-08-30 17:47:04 +00:00
|
|
|
|
2008-04-14 15:32:42 +00:00
|
|
|
/* {{{ proto array ini_get_all([string extension[, bool details = true]])
|
2001-08-30 17:47:04 +00:00
|
|
|
Get all configuration options */
|
|
|
|
PHP_FUNCTION(ini_get_all)
|
|
|
|
{
|
|
|
|
char *extname = NULL;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t extname_len = 0, extnumber = 0;
|
2001-08-30 17:47:04 +00:00
|
|
|
zend_module_entry *module;
|
2008-04-14 15:32:42 +00:00
|
|
|
zend_bool details = 1;
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(0, 2)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_STRING_EX(extname, extname_len, 1, 0)
|
|
|
|
Z_PARAM_BOOL(details)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2001-08-30 17:47:04 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_ini_sort_entries();
|
2001-08-30 17:47:04 +00:00
|
|
|
|
2002-10-03 10:42:57 +00:00
|
|
|
if (extname) {
|
2014-02-10 08:18:01 +00:00
|
|
|
if ((module = zend_hash_str_find_ptr(&module_registry, extname, extname_len)) == NULL) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Unable to find extension '%s'", extname);
|
2001-08-30 17:47:04 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
extnumber = module->module_number;
|
|
|
|
}
|
|
|
|
|
|
|
|
array_init(return_value);
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_hash_apply_with_arguments(EG(ini_directives), php_ini_get_option, 2, return_value, extnumber, details);
|
2001-08-30 17:47:04 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2017-07-29 04:31:47 +00:00
|
|
|
static int php_ini_check_path(char *option_name, size_t option_len, char *new_option_name, size_t new_option_len) /* {{{ */
|
2002-08-16 01:39:10 +00:00
|
|
|
{
|
2017-07-29 04:31:47 +00:00
|
|
|
if (option_len + 1 != new_option_len) {
|
2002-08-16 01:39:10 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2003-10-20 01:59:35 +00:00
|
|
|
return !strncmp(option_name, new_option_name, option_len);
|
2002-08-16 01:39:10 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
/* }}} */
|
2002-08-16 01:39:10 +00:00
|
|
|
|
2000-03-29 01:39:04 +00:00
|
|
|
/* {{{ proto string ini_set(string varname, string newvalue)
|
2000-08-14 08:37:28 +00:00
|
|
|
Set a configuration option, returns false on error and the old value of the configuration option on success */
|
2000-02-26 14:53:18 +00:00
|
|
|
PHP_FUNCTION(ini_set)
|
1999-04-17 00:37:12 +00:00
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_string *varname;
|
2014-09-01 16:57:33 +00:00
|
|
|
zend_string *new_value;
|
2017-12-11 15:18:30 +00:00
|
|
|
zend_string *val;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_STR(varname)
|
|
|
|
Z_PARAM_STR(new_value)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2017-12-11 15:18:30 +00:00
|
|
|
val = zend_ini_get_value(varname);
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2000-09-05 18:33:02 +00:00
|
|
|
/* copy to return here, because alter might free it! */
|
2017-12-11 15:18:30 +00:00
|
|
|
if (val) {
|
|
|
|
if (ZSTR_IS_INTERNED(val)) {
|
|
|
|
RETVAL_INTERNED_STR(val);
|
|
|
|
} else if (ZSTR_LEN(val) == 0) {
|
2017-05-18 14:59:59 +00:00
|
|
|
RETVAL_EMPTY_STRING();
|
2017-12-11 15:18:30 +00:00
|
|
|
} else if (ZSTR_LEN(val) == 1) {
|
|
|
|
RETVAL_INTERNED_STR(ZSTR_CHAR((zend_uchar)ZSTR_VAL(val)[0]));
|
|
|
|
} else if (!(GC_FLAGS(val) & GC_PERSISTENT)) {
|
|
|
|
ZVAL_NEW_STR(return_value, zend_string_copy(val));
|
2017-05-18 14:59:59 +00:00
|
|
|
} else {
|
2017-12-11 15:18:30 +00:00
|
|
|
ZVAL_NEW_STR(return_value, zend_string_init(ZSTR_VAL(val), ZSTR_LEN(val), 0));
|
2017-05-18 14:59:59 +00:00
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
} else {
|
2000-09-05 18:33:02 +00:00
|
|
|
RETVAL_FALSE;
|
|
|
|
}
|
|
|
|
|
2017-07-29 04:31:47 +00:00
|
|
|
#define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini))
|
2010-04-26 23:53:30 +00:00
|
|
|
/* open basedir check */
|
|
|
|
if (PG(open_basedir)) {
|
2015-06-30 01:05:24 +00:00
|
|
|
if (_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "error_log") ||
|
|
|
|
_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.class.path") ||
|
|
|
|
_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.home") ||
|
|
|
|
_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "mail.log") ||
|
|
|
|
_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "java.library.path") ||
|
|
|
|
_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "vpopmail.directory")) {
|
|
|
|
if (php_check_open_basedir(ZSTR_VAL(new_value))) {
|
2018-07-04 16:22:24 +00:00
|
|
|
zval_ptr_dtor_str(return_value);
|
2002-08-16 10:08:32 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2002-08-16 01:39:10 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2017-07-29 04:31:47 +00:00
|
|
|
#undef _CHECK_PATH
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
|
2018-07-04 16:22:24 +00:00
|
|
|
zval_ptr_dtor_str(return_value);
|
1999-04-17 00:37:12 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2003-05-16 01:09:58 +00:00
|
|
|
/* {{{ proto void ini_restore(string varname)
|
2000-03-29 01:39:04 +00:00
|
|
|
Restore the value of a configuration option specified by varname */
|
1999-04-17 00:37:12 +00:00
|
|
|
PHP_FUNCTION(ini_restore)
|
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_string *varname;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STR(varname)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_restore_ini_entry(varname, PHP_INI_STAGE_RUNTIME);
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2004-12-27 18:22:50 +00:00
|
|
|
/* {{{ proto string set_include_path(string new_include_path)
|
2002-11-05 06:05:48 +00:00
|
|
|
Sets the include_path configuration option */
|
|
|
|
PHP_FUNCTION(set_include_path)
|
|
|
|
{
|
2014-09-01 16:57:33 +00:00
|
|
|
zend_string *new_value;
|
2002-11-05 06:05:48 +00:00
|
|
|
char *old_value;
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_string *key;
|
2002-11-05 06:05:48 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_PATH_STR(new_value)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-03-05 04:16:57 +00:00
|
|
|
old_value = zend_ini_string("include_path", sizeof("include_path") - 1, 0);
|
2002-11-05 06:05:48 +00:00
|
|
|
/* copy to return here, because alter might free it! */
|
|
|
|
if (old_value) {
|
2014-02-10 08:18:01 +00:00
|
|
|
RETVAL_STRING(old_value);
|
2002-11-05 06:05:48 +00:00
|
|
|
} else {
|
|
|
|
RETVAL_FALSE;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
key = zend_string_init("include_path", sizeof("include_path") - 1, 0);
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_alter_ini_entry_ex(key, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(key, 0);
|
2018-07-04 16:22:24 +00:00
|
|
|
zval_ptr_dtor_str(return_value);
|
2002-11-05 06:05:48 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(key, 0);
|
2002-11-05 06:05:48 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ proto string get_include_path()
|
|
|
|
Get the current include_path configuration option */
|
|
|
|
PHP_FUNCTION(get_include_path)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *str;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
2007-10-01 12:40:54 +00:00
|
|
|
return;
|
2002-11-05 06:05:48 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-03-05 04:16:57 +00:00
|
|
|
str = zend_ini_string("include_path", sizeof("include_path") - 1, 0);
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2002-11-05 06:05:48 +00:00
|
|
|
if (str == NULL) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(str);
|
2002-11-05 06:05:48 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2003-05-16 01:09:58 +00:00
|
|
|
/* {{{ proto void restore_include_path()
|
2002-11-05 06:05:48 +00:00
|
|
|
Restore the value of the include_path configuration option */
|
|
|
|
PHP_FUNCTION(restore_include_path)
|
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_string *key;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
2007-10-01 12:40:54 +00:00
|
|
|
return;
|
2002-11-05 06:05:48 +00:00
|
|
|
}
|
2014-08-25 17:24:55 +00:00
|
|
|
key = zend_string_init("include_path", sizeof("include_path")-1, 0);
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_restore_ini_entry(key, PHP_INI_STAGE_RUNTIME);
|
2018-05-08 14:30:15 +00:00
|
|
|
zend_string_efree(key);
|
2002-11-05 06:05:48 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2005-03-10 14:33:53 +00:00
|
|
|
/* {{{ proto mixed print_r(mixed var [, bool return])
|
2002-07-25 11:22:20 +00:00
|
|
|
Prints out or returns information about the specified variable */
|
1999-04-17 00:37:12 +00:00
|
|
|
PHP_FUNCTION(print_r)
|
|
|
|
{
|
2002-07-25 11:22:20 +00:00
|
|
|
zval *var;
|
2007-10-01 12:40:54 +00:00
|
|
|
zend_bool do_return = 0;
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 2)
|
2017-06-19 09:55:59 +00:00
|
|
|
Z_PARAM_ZVAL(var)
|
2016-12-31 00:06:20 +00:00
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_BOOL(do_return)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2007-10-01 12:40:54 +00:00
|
|
|
|
|
|
|
if (do_return) {
|
2015-10-07 09:35:43 +00:00
|
|
|
RETURN_STR(zend_print_zval_r_to_str(var, 0));
|
2002-07-25 11:22:20 +00:00
|
|
|
} else {
|
2015-10-07 09:35:43 +00:00
|
|
|
zend_print_zval_r(var, 0);
|
2002-07-25 11:22:20 +00:00
|
|
|
RETURN_TRUE;
|
|
|
|
}
|
1999-04-17 00:37:12 +00:00
|
|
|
}
|
2000-03-29 01:39:04 +00:00
|
|
|
/* }}} */
|
1999-04-17 00:37:12 +00:00
|
|
|
|
1999-09-04 21:10:39 +00:00
|
|
|
/* {{{ proto int connection_aborted(void)
|
|
|
|
Returns true if client disconnected */
|
|
|
|
PHP_FUNCTION(connection_aborted)
|
|
|
|
{
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(PG(connection_status) & PHP_CONNECTION_ABORTED);
|
1999-09-04 21:10:39 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ proto int connection_status(void)
|
|
|
|
Returns the connection status bitfield */
|
|
|
|
PHP_FUNCTION(connection_status)
|
|
|
|
{
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(PG(connection_status));
|
1999-09-04 21:10:39 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2015-06-25 17:30:41 +00:00
|
|
|
/* {{{ proto int ignore_user_abort([bool value])
|
1999-09-04 21:10:39 +00:00
|
|
|
Set whether we want to ignore a user abort event or not */
|
|
|
|
PHP_FUNCTION(ignore_user_abort)
|
|
|
|
{
|
2015-06-25 17:30:41 +00:00
|
|
|
zend_bool arg = 0;
|
2001-08-29 16:00:30 +00:00
|
|
|
int old_setting;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(0, 1)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_BOOL(arg)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2016-07-05 12:57:16 +00:00
|
|
|
old_setting = (unsigned short)PG(ignore_user_abort);
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2016-05-31 14:24:02 +00:00
|
|
|
if (ZEND_NUM_ARGS()) {
|
2015-08-24 13:09:16 +00:00
|
|
|
zend_string *key = zend_string_init("ignore_user_abort", sizeof("ignore_user_abort") - 1, 0);
|
2015-06-25 17:30:41 +00:00
|
|
|
zend_alter_ini_entry_chars(key, arg ? "1" : "0", 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(key, 0);
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(old_setting);
|
1999-09-04 21:10:39 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
#if HAVE_GETSERVBYNAME
|
1999-11-01 01:07:51 +00:00
|
|
|
/* {{{ proto int getservbyname(string service, string protocol)
|
2002-01-05 07:54:49 +00:00
|
|
|
Returns port associated with service. Protocol must be "tcp" or "udp" */
|
1999-11-01 01:07:51 +00:00
|
|
|
PHP_FUNCTION(getservbyname)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *name, *proto;
|
2014-08-27 18:42:47 +00:00
|
|
|
size_t name_len, proto_len;
|
1999-11-01 01:07:51 +00:00
|
|
|
struct servent *serv;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_STRING(name, name_len)
|
|
|
|
Z_PARAM_STRING(proto, proto_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2010-01-24 13:36:08 +00:00
|
|
|
|
2015-01-03 09:22:58 +00:00
|
|
|
/* empty string behaves like NULL on windows implementation of
|
2010-01-24 13:36:08 +00:00
|
|
|
getservbyname. Let be portable instead. */
|
|
|
|
#ifdef PHP_WIN32
|
|
|
|
if (proto_len == 0) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
serv = getservbyname(name, proto);
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2017-01-09 05:13:46 +00:00
|
|
|
#if defined(_AIX)
|
|
|
|
/*
|
|
|
|
On AIX, imap is only known as imap2 in /etc/services, while on Linux imap is an alias for imap2.
|
|
|
|
If a request for imap gives no result, we try again with imap2.
|
|
|
|
*/
|
|
|
|
if (serv == NULL && strcmp(name, "imap") == 0) {
|
|
|
|
serv = getservbyname("imap2", proto);
|
|
|
|
}
|
|
|
|
#endif
|
2001-08-29 16:00:30 +00:00
|
|
|
if (serv == NULL) {
|
1999-11-01 01:07:51 +00:00
|
|
|
RETURN_FALSE;
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(ntohs(serv->s_port));
|
1999-11-01 01:07:51 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
2001-08-29 16:00:30 +00:00
|
|
|
#endif
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
#if HAVE_GETSERVBYPORT
|
1999-11-01 01:07:51 +00:00
|
|
|
/* {{{ proto string getservbyport(int port, string protocol)
|
2002-01-05 07:54:49 +00:00
|
|
|
Returns service name associated with port. Protocol must be "tcp" or "udp" */
|
1999-11-01 01:07:51 +00:00
|
|
|
PHP_FUNCTION(getservbyport)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *proto;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t proto_len;
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long port;
|
1999-11-01 01:07:51 +00:00
|
|
|
struct servent *serv;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_LONG(port)
|
|
|
|
Z_PARAM_STRING(proto, proto_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
serv = getservbyport(htons((unsigned short) port), proto);
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
if (serv == NULL) {
|
1999-11-01 01:07:51 +00:00
|
|
|
RETURN_FALSE;
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(serv->s_name);
|
1999-11-01 01:07:51 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
2001-08-29 16:00:30 +00:00
|
|
|
#endif
|
1999-11-01 01:07:51 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
#if HAVE_GETPROTOBYNAME
|
1999-11-02 03:47:09 +00:00
|
|
|
/* {{{ proto int getprotobyname(string name)
|
2000-02-24 07:46:56 +00:00
|
|
|
Returns protocol number associated with name as per /etc/protocols */
|
1999-11-02 03:47:09 +00:00
|
|
|
PHP_FUNCTION(getprotobyname)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *name;
|
2014-08-27 17:25:28 +00:00
|
|
|
size_t name_len;
|
1999-11-02 03:47:09 +00:00
|
|
|
struct protoent *ent;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(name, name_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-11-02 03:47:09 +00:00
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
ent = getprotobyname(name);
|
1999-11-02 03:47:09 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
if (ent == NULL) {
|
2002-10-04 17:17:01 +00:00
|
|
|
RETURN_FALSE;
|
1999-11-02 03:47:09 +00:00
|
|
|
}
|
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
RETURN_LONG(ent->p_proto);
|
1999-11-02 03:47:09 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
2001-08-29 16:00:30 +00:00
|
|
|
#endif
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
#if HAVE_GETPROTOBYNUMBER
|
1999-11-02 03:47:09 +00:00
|
|
|
/* {{{ proto string getprotobynumber(int proto)
|
2000-02-24 07:46:56 +00:00
|
|
|
Returns protocol name associated with protocol number proto */
|
1999-11-02 03:47:09 +00:00
|
|
|
PHP_FUNCTION(getprotobynumber)
|
|
|
|
{
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long proto;
|
1999-11-02 03:47:09 +00:00
|
|
|
struct protoent *ent;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_LONG(proto)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
1999-11-02 03:47:09 +00:00
|
|
|
|
2014-10-22 15:27:33 +00:00
|
|
|
ent = getprotobynumber((int)proto);
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2001-08-29 16:00:30 +00:00
|
|
|
if (ent == NULL) {
|
1999-11-02 03:47:09 +00:00
|
|
|
RETURN_FALSE;
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
1999-11-02 03:47:09 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
RETURN_STRING(ent->p_name);
|
1999-11-02 03:47:09 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
2001-08-29 16:00:30 +00:00
|
|
|
#endif
|
1999-11-02 03:47:09 +00:00
|
|
|
|
2001-12-07 09:34:50 +00:00
|
|
|
/* {{{ proto bool register_tick_function(string function_name [, mixed arg [, mixed ... ]])
|
2000-09-01 16:10:17 +00:00
|
|
|
Registers a tick callback function */
|
|
|
|
PHP_FUNCTION(register_tick_function)
|
|
|
|
{
|
|
|
|
user_tick_function_entry tick_fe;
|
|
|
|
int i;
|
2014-02-25 12:03:34 +00:00
|
|
|
zend_string *function_name = NULL;
|
2000-09-01 16:10:17 +00:00
|
|
|
|
2002-07-16 14:14:22 +00:00
|
|
|
tick_fe.calling = 0;
|
2000-09-01 16:10:17 +00:00
|
|
|
tick_fe.arg_count = ZEND_NUM_ARGS();
|
2003-04-03 01:12:47 +00:00
|
|
|
|
2000-09-01 16:10:17 +00:00
|
|
|
if (tick_fe.arg_count < 1) {
|
|
|
|
WRONG_PARAM_COUNT;
|
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
tick_fe.arguments = (zval *) safe_emalloc(sizeof(zval), tick_fe.arg_count, 0);
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_get_parameters_array(ZEND_NUM_ARGS(), tick_fe.arg_count, tick_fe.arguments) == FAILURE) {
|
2006-04-03 13:46:11 +00:00
|
|
|
efree(tick_fe.arguments);
|
2000-09-01 16:10:17 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (!zend_is_callable(&tick_fe.arguments[0], 0, &function_name)) {
|
2008-04-21 14:32:57 +00:00
|
|
|
efree(tick_fe.arguments);
|
2015-06-30 01:05:24 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Invalid tick callback '%s' passed", ZSTR_VAL(function_name));
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(function_name, 0);
|
2008-04-21 14:32:57 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
} else if (function_name) {
|
2018-05-28 13:27:12 +00:00
|
|
|
zend_string_release_ex(function_name, 0);
|
2008-04-20 15:07:39 +00:00
|
|
|
}
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (Z_TYPE(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE(tick_fe.arguments[0]) != IS_OBJECT) {
|
2000-09-01 16:10:17 +00:00
|
|
|
convert_to_string_ex(&tick_fe.arguments[0]);
|
2007-10-01 12:40:54 +00:00
|
|
|
}
|
2000-12-18 19:23:50 +00:00
|
|
|
|
2000-09-01 16:10:17 +00:00
|
|
|
if (!BG(user_tick_functions)) {
|
2001-08-29 16:00:30 +00:00
|
|
|
BG(user_tick_functions) = (zend_llist *) emalloc(sizeof(zend_llist));
|
|
|
|
zend_llist_init(BG(user_tick_functions),
|
|
|
|
sizeof(user_tick_function_entry),
|
2002-02-21 03:32:42 +00:00
|
|
|
(llist_dtor_func_t) user_tick_function_dtor, 0);
|
2015-09-28 09:21:17 +00:00
|
|
|
php_add_tick_function(run_user_tick_functions, NULL);
|
2000-09-01 16:10:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < tick_fe.arg_count; i++) {
|
2017-11-01 02:25:10 +00:00
|
|
|
Z_TRY_ADDREF(tick_fe.arguments[i]);
|
2000-09-01 16:10:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
zend_llist_add_element(BG(user_tick_functions), &tick_fe);
|
|
|
|
|
|
|
|
RETURN_TRUE;
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
|
|
|
/* {{{ proto void unregister_tick_function(string function_name)
|
|
|
|
Unregisters a tick callback function */
|
|
|
|
PHP_FUNCTION(unregister_tick_function)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
zval *function;
|
2000-09-01 16:10:17 +00:00
|
|
|
user_tick_function_entry tick_fe;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
2017-06-19 09:55:59 +00:00
|
|
|
Z_PARAM_ZVAL(function)
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2000-09-01 16:10:17 +00:00
|
|
|
|
2003-04-03 01:12:47 +00:00
|
|
|
if (!BG(user_tick_functions)) {
|
|
|
|
return;
|
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2013-11-17 09:04:37 +00:00
|
|
|
if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) {
|
2007-10-01 12:40:54 +00:00
|
|
|
convert_to_string(function);
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
tick_fe.arguments = (zval *) emalloc(sizeof(zval));
|
|
|
|
ZVAL_COPY_VALUE(&tick_fe.arguments[0], function);
|
2000-09-01 16:10:17 +00:00
|
|
|
tick_fe.arg_count = 1;
|
2001-08-29 16:00:30 +00:00
|
|
|
zend_llist_del_element(BG(user_tick_functions), &tick_fe, (int (*)(void *, void *)) user_tick_function_compare);
|
2000-09-01 16:10:17 +00:00
|
|
|
efree(tick_fe.arguments);
|
|
|
|
}
|
|
|
|
/* }}} */
|
1999-12-16 23:47:10 +00:00
|
|
|
|
2001-07-02 11:11:58 +00:00
|
|
|
/* {{{ proto bool is_uploaded_file(string path)
|
2007-11-02 19:40:39 +00:00
|
|
|
Check if file was created by rfc1867 upload */
|
2000-09-08 21:58:28 +00:00
|
|
|
PHP_FUNCTION(is_uploaded_file)
|
2000-09-08 21:56:47 +00:00
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *path;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t path_len;
|
2000-09-08 21:56:47 +00:00
|
|
|
|
|
|
|
if (!SG(rfc1867_uploaded_files)) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 1)
|
|
|
|
Z_PARAM_STRING(path, path_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) {
|
2000-09-08 21:56:47 +00:00
|
|
|
RETURN_TRUE;
|
|
|
|
} else {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
}
|
2000-10-11 11:25:13 +00:00
|
|
|
/* }}} */
|
2000-09-08 21:56:47 +00:00
|
|
|
|
2001-07-02 11:11:58 +00:00
|
|
|
/* {{{ proto bool move_uploaded_file(string path, string new_path)
|
2001-12-07 09:34:50 +00:00
|
|
|
Move a file if and only if it was created by an upload */
|
2000-09-08 22:31:21 +00:00
|
|
|
PHP_FUNCTION(move_uploaded_file)
|
|
|
|
{
|
2007-10-01 12:40:54 +00:00
|
|
|
char *path, *new_path;
|
2014-08-27 13:31:48 +00:00
|
|
|
size_t path_len, new_path_len;
|
2001-08-29 16:00:30 +00:00
|
|
|
zend_bool successful = 0;
|
2000-09-08 22:31:21 +00:00
|
|
|
|
2007-10-22 07:37:37 +00:00
|
|
|
#ifndef PHP_WIN32
|
|
|
|
int oldmask; int ret;
|
|
|
|
#endif
|
|
|
|
|
2000-09-08 22:31:21 +00:00
|
|
|
if (!SG(rfc1867_uploaded_files)) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(2, 2)
|
|
|
|
Z_PARAM_STRING(path, path_len)
|
|
|
|
Z_PARAM_PATH(new_path, new_path_len)
|
|
|
|
ZEND_PARSE_PARAMETERS_END();
|
2000-09-08 22:31:21 +00:00
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (!zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) {
|
2000-09-08 22:31:21 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2001-04-17 17:06:06 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
if (php_check_open_basedir(new_path)) {
|
2002-03-17 20:56:20 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
|
|
|
|
2007-10-01 12:40:54 +00:00
|
|
|
if (VCWD_RENAME(path, new_path) == 0) {
|
2001-08-29 16:00:30 +00:00
|
|
|
successful = 1;
|
2007-10-22 07:37:37 +00:00
|
|
|
#ifndef PHP_WIN32
|
|
|
|
oldmask = umask(077);
|
|
|
|
umask(oldmask);
|
|
|
|
|
|
|
|
ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);
|
|
|
|
|
|
|
|
if (ret == -1) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "%s", strerror(errno));
|
2007-10-22 07:37:37 +00:00
|
|
|
}
|
|
|
|
#endif
|
2014-12-13 22:06:14 +00:00
|
|
|
} else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR) == SUCCESS) {
|
2007-10-01 12:40:54 +00:00
|
|
|
VCWD_UNLINK(path);
|
2001-08-29 16:00:30 +00:00
|
|
|
successful = 1;
|
2000-09-08 22:31:21 +00:00
|
|
|
}
|
|
|
|
|
2000-09-09 11:41:14 +00:00
|
|
|
if (successful) {
|
2014-02-10 08:18:01 +00:00
|
|
|
zend_hash_str_del(SG(rfc1867_uploaded_files), path, path_len);
|
2000-09-09 11:41:14 +00:00
|
|
|
} else {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
|
2000-09-08 22:31:21 +00:00
|
|
|
}
|
2007-10-01 12:40:54 +00:00
|
|
|
|
2000-09-09 11:41:14 +00:00
|
|
|
RETURN_BOOL(successful);
|
2000-09-08 22:31:21 +00:00
|
|
|
}
|
2000-10-11 11:25:13 +00:00
|
|
|
/* }}} */
|
2000-09-08 22:31:21 +00:00
|
|
|
|
2007-08-31 10:46:19 +00:00
|
|
|
/* {{{ php_simple_ini_parser_cb
|
|
|
|
*/
|
2014-12-13 22:06:14 +00:00
|
|
|
static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
|
2000-10-29 22:42:01 +00:00
|
|
|
{
|
|
|
|
switch (callback_type) {
|
2007-08-31 10:46:19 +00:00
|
|
|
|
2000-10-29 22:42:01 +00:00
|
|
|
case ZEND_INI_PARSER_ENTRY:
|
2018-09-15 15:08:58 +00:00
|
|
|
if (!arg2) {
|
|
|
|
/* bare string - nothing to do */
|
|
|
|
break;
|
|
|
|
}
|
2016-11-18 13:17:52 +00:00
|
|
|
Z_TRY_ADDREF_P(arg2);
|
|
|
|
zend_symtable_update(Z_ARRVAL_P(arr), Z_STR_P(arg1), arg2);
|
2000-10-29 22:42:01 +00:00
|
|
|
break;
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2003-01-19 12:18:46 +00:00
|
|
|
case ZEND_INI_PARSER_POP_ENTRY:
|
2001-08-29 16:00:30 +00:00
|
|
|
{
|
2014-02-10 08:18:01 +00:00
|
|
|
zval hash, *find_hash;
|
2001-08-29 16:00:30 +00:00
|
|
|
|
2018-09-15 15:08:58 +00:00
|
|
|
if (!arg2) {
|
|
|
|
/* bare string - nothing to do */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2014-08-25 17:24:55 +00:00
|
|
|
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) {
|
2017-07-28 12:54:01 +00:00
|
|
|
zend_ulong key = (zend_ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
|
2014-02-10 08:18:01 +00:00
|
|
|
if ((find_hash = zend_hash_index_find(Z_ARRVAL_P(arr), key)) == NULL) {
|
|
|
|
array_init(&hash);
|
2017-12-04 10:21:35 +00:00
|
|
|
find_hash = zend_hash_index_add_new(Z_ARRVAL_P(arr), key, &hash);
|
2015-01-03 09:22:58 +00:00
|
|
|
}
|
2007-06-26 12:10:08 +00:00
|
|
|
} else {
|
2014-02-10 08:18:01 +00:00
|
|
|
if ((find_hash = zend_hash_find(Z_ARRVAL_P(arr), Z_STR_P(arg1))) == NULL) {
|
|
|
|
array_init(&hash);
|
2017-12-04 10:21:35 +00:00
|
|
|
find_hash = zend_hash_add_new(Z_ARRVAL_P(arr), Z_STR_P(arg1), &hash);
|
2015-01-03 09:22:58 +00:00
|
|
|
}
|
2000-10-29 23:34:33 +00:00
|
|
|
}
|
2003-01-19 12:18:46 +00:00
|
|
|
|
2014-03-09 03:35:20 +00:00
|
|
|
if (Z_TYPE_P(find_hash) != IS_ARRAY) {
|
2018-07-05 10:32:39 +00:00
|
|
|
zval_ptr_dtor_nogc(find_hash);
|
2014-03-09 03:35:20 +00:00
|
|
|
array_init(find_hash);
|
2007-03-08 00:44:23 +00:00
|
|
|
}
|
|
|
|
|
2015-08-15 06:44:07 +00:00
|
|
|
if (!arg3 || (Z_TYPE_P(arg3) == IS_STRING && Z_STRLEN_P(arg3) == 0)) {
|
2016-11-18 13:17:52 +00:00
|
|
|
Z_TRY_ADDREF_P(arg2);
|
|
|
|
add_next_index_zval(find_hash, arg2);
|
2015-08-15 06:44:07 +00:00
|
|
|
} else {
|
2016-11-18 13:17:52 +00:00
|
|
|
array_set_zval_key(Z_ARRVAL_P(find_hash), arg3, arg2);
|
2007-09-28 02:05:10 +00:00
|
|
|
}
|
2001-08-29 16:00:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-10-29 23:34:33 +00:00
|
|
|
case ZEND_INI_PARSER_SECTION:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2007-08-31 10:46:19 +00:00
|
|
|
/* }}} */
|
2000-10-29 23:34:33 +00:00
|
|
|
|
2007-08-31 10:46:19 +00:00
|
|
|
/* {{{ php_ini_parser_cb_with_sections
|
|
|
|
*/
|
2014-12-13 22:06:14 +00:00
|
|
|
static void php_ini_parser_cb_with_sections(zval *arg1, zval *arg2, zval *arg3, int callback_type, zval *arr)
|
2003-01-19 12:18:46 +00:00
|
|
|
{
|
|
|
|
if (callback_type == ZEND_INI_PARSER_SECTION) {
|
2014-02-10 08:18:01 +00:00
|
|
|
array_init(&BG(active_ini_file_section));
|
|
|
|
zend_symtable_update(Z_ARRVAL_P(arr), Z_STR_P(arg1), &BG(active_ini_file_section));
|
2018-09-15 15:08:58 +00:00
|
|
|
} else if (arg2) {
|
2003-01-19 12:18:46 +00:00
|
|
|
zval *active_arr;
|
|
|
|
|
2014-02-10 08:18:01 +00:00
|
|
|
if (Z_TYPE(BG(active_ini_file_section)) != IS_UNDEF) {
|
|
|
|
active_arr = &BG(active_ini_file_section);
|
2003-01-19 12:18:46 +00:00
|
|
|
} else {
|
|
|
|
active_arr = arr;
|
|
|
|
}
|
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
php_simple_ini_parser_cb(arg1, arg2, arg3, callback_type, active_arr);
|
2003-01-19 12:18:46 +00:00
|
|
|
}
|
|
|
|
}
|
2007-08-31 10:46:19 +00:00
|
|
|
/* }}} */
|
2000-10-29 23:34:33 +00:00
|
|
|
|
2007-09-28 02:05:10 +00:00
|
|
|
/* {{{ proto array parse_ini_file(string filename [, bool process_sections [, int scanner_mode]])
|
2000-10-29 22:42:01 +00:00
|
|
|
Parse configuration file */
|
|
|
|
PHP_FUNCTION(parse_ini_file)
|
|
|
|
{
|
2007-09-28 02:05:10 +00:00
|
|
|
char *filename = NULL;
|
2014-08-27 15:31:24 +00:00
|
|
|
size_t filename_len = 0;
|
2007-09-28 02:05:10 +00:00
|
|
|
zend_bool process_sections = 0;
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
|
2000-10-29 22:42:01 +00:00
|
|
|
zend_file_handle fh;
|
2000-10-29 23:34:33 +00:00
|
|
|
zend_ini_parser_cb_t ini_parser_cb;
|
2000-10-29 22:42:01 +00:00
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 3)
|
|
|
|
Z_PARAM_PATH(filename, filename_len)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_BOOL(process_sections)
|
|
|
|
Z_PARAM_LONG(scanner_mode)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2007-08-31 10:46:19 +00:00
|
|
|
|
2007-09-28 02:05:10 +00:00
|
|
|
if (filename_len == 0) {
|
2014-12-13 22:06:14 +00:00
|
|
|
php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
|
2007-09-28 02:05:10 +00:00
|
|
|
RETURN_FALSE;
|
2000-10-29 22:42:01 +00:00
|
|
|
}
|
2000-10-29 23:34:33 +00:00
|
|
|
|
2007-09-28 02:05:10 +00:00
|
|
|
/* Set callback function */
|
|
|
|
if (process_sections) {
|
2014-02-10 08:18:01 +00:00
|
|
|
ZVAL_UNDEF(&BG(active_ini_file_section));
|
2007-09-28 02:05:10 +00:00
|
|
|
ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
|
|
|
|
} else {
|
|
|
|
ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
|
|
|
|
}
|
2002-05-11 19:19:49 +00:00
|
|
|
|
2007-09-28 02:05:10 +00:00
|
|
|
/* Setup filehandle */
|
2003-02-18 09:37:54 +00:00
|
|
|
memset(&fh, 0, sizeof(fh));
|
2007-09-28 02:05:10 +00:00
|
|
|
fh.filename = filename;
|
|
|
|
fh.type = ZEND_HANDLE_FILENAME;
|
2007-08-31 10:46:19 +00:00
|
|
|
|
2000-10-29 22:42:01 +00:00
|
|
|
array_init(return_value);
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_parse_ini_file(&fh, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
|
2018-07-04 16:22:24 +00:00
|
|
|
zend_array_destroy(Z_ARR_P(return_value));
|
2008-08-31 00:19:50 +00:00
|
|
|
RETURN_FALSE;
|
|
|
|
}
|
2007-09-28 02:05:10 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2008-11-05 21:35:02 +00:00
|
|
|
/* {{{ proto array parse_ini_string(string ini_string [, bool process_sections [, int scanner_mode]])
|
|
|
|
Parse configuration string */
|
|
|
|
PHP_FUNCTION(parse_ini_string)
|
|
|
|
{
|
|
|
|
char *string = NULL, *str = NULL;
|
2014-08-27 15:31:24 +00:00
|
|
|
size_t str_len = 0;
|
2008-11-05 21:35:02 +00:00
|
|
|
zend_bool process_sections = 0;
|
2014-08-25 17:24:55 +00:00
|
|
|
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
|
2008-11-05 21:35:02 +00:00
|
|
|
zend_ini_parser_cb_t ini_parser_cb;
|
|
|
|
|
2016-12-31 00:06:20 +00:00
|
|
|
ZEND_PARSE_PARAMETERS_START(1, 3)
|
|
|
|
Z_PARAM_STRING(str, str_len)
|
|
|
|
Z_PARAM_OPTIONAL
|
|
|
|
Z_PARAM_BOOL(process_sections)
|
|
|
|
Z_PARAM_LONG(scanner_mode)
|
|
|
|
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
2008-11-05 21:35:02 +00:00
|
|
|
|
2011-09-26 08:38:03 +00:00
|
|
|
if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
|
|
|
|
RETVAL_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-11-05 21:35:02 +00:00
|
|
|
/* Set callback function */
|
|
|
|
if (process_sections) {
|
2014-02-10 08:18:01 +00:00
|
|
|
ZVAL_UNDEF(&BG(active_ini_file_section));
|
2008-11-05 21:35:02 +00:00
|
|
|
ini_parser_cb = (zend_ini_parser_cb_t) php_ini_parser_cb_with_sections;
|
|
|
|
} else {
|
|
|
|
ini_parser_cb = (zend_ini_parser_cb_t) php_simple_ini_parser_cb;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Setup string */
|
|
|
|
string = (char *) emalloc(str_len + ZEND_MMAP_AHEAD);
|
|
|
|
memcpy(string, str, str_len);
|
|
|
|
memset(string + str_len, 0, ZEND_MMAP_AHEAD);
|
|
|
|
|
|
|
|
array_init(return_value);
|
2014-12-13 22:06:14 +00:00
|
|
|
if (zend_parse_ini_string(string, 0, (int)scanner_mode, ini_parser_cb, return_value) == FAILURE) {
|
2018-07-04 16:22:24 +00:00
|
|
|
zend_array_destroy(Z_ARR_P(return_value));
|
2008-11-05 21:35:02 +00:00
|
|
|
RETVAL_FALSE;
|
|
|
|
}
|
|
|
|
efree(string);
|
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
|
2008-04-15 08:44:21 +00:00
|
|
|
#if ZEND_DEBUG
|
2015-01-03 09:22:58 +00:00
|
|
|
/* This function returns an array of ALL valid ini options with values and
|
2008-04-15 08:44:21 +00:00
|
|
|
* is not the same as ini_get_all() which returns only registered ini options. Only useful for devs to debug php.ini scanner/parser! */
|
|
|
|
PHP_FUNCTION(config_get_hash) /* {{{ */
|
|
|
|
{
|
|
|
|
HashTable *hash = php_ini_get_configuration_hash();
|
|
|
|
|
|
|
|
array_init(return_value);
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_hash_apply_with_arguments(hash, add_config_entry_cb, 1, return_value);
|
2008-04-15 08:44:21 +00:00
|
|
|
}
|
|
|
|
/* }}} */
|
|
|
|
#endif
|
|
|
|
|
2006-02-16 22:49:13 +00:00
|
|
|
#ifdef HAVE_GETLOADAVG
|
2006-10-02 07:58:13 +00:00
|
|
|
/* {{{ proto array sys_getloadavg()
|
2007-10-01 12:40:54 +00:00
|
|
|
*/
|
2006-02-18 05:41:59 +00:00
|
|
|
PHP_FUNCTION(sys_getloadavg)
|
2006-02-16 22:49:13 +00:00
|
|
|
{
|
|
|
|
double load[3];
|
|
|
|
|
2010-04-21 22:04:19 +00:00
|
|
|
if (zend_parse_parameters_none() == FAILURE) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-02-16 22:49:13 +00:00
|
|
|
if (getloadavg(load, 3) == -1) {
|
|
|
|
RETURN_FALSE;
|
|
|
|
} else {
|
|
|
|
array_init(return_value);
|
|
|
|
add_index_double(return_value, 0, load[0]);
|
|
|
|
add_index_double(return_value, 1, load[1]);
|
|
|
|
add_index_double(return_value, 2, load[2]);
|
|
|
|
}
|
|
|
|
}
|
2006-10-02 07:58:13 +00:00
|
|
|
/* }}} */
|
2006-02-16 22:49:13 +00:00
|
|
|
#endif
|
|
|
|
|
1999-04-17 00:37:12 +00:00
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* End:
|
2001-12-07 13:20:18 +00:00
|
|
|
* vim600: fdm=marker
|
|
|
|
* vim: noet sw=4 ts=4
|
2000-12-18 19:23:50 +00:00
|
|
|
*/
|