Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions | Variables
basic_functions.h File Reference
#include <sys/stat.h>
#include "php_filestat.h"
#include "zend_highlight.h"
#include "url_scanner_ex.h"

Go to the source code of this file.

Classes

struct  _php_basic_globals

Defines

#define basic_functions_module_ptr   &basic_functions_module
#define MT_N   (624)
#define BG(v)   (basic_globals.v)
#define SAFE_MODE_PROTECTED_ENV_VARS   "LD_LIBRARY_PATH"
#define SAFE_MODE_ALLOWED_ENV_VARS   "PHP_"

Typedefs

typedef struct _php_basic_globals php_basic_globals

Functions

 PHP_MINIT_FUNCTION (basic)
 PHP_MSHUTDOWN_FUNCTION (basic)
 PHP_RINIT_FUNCTION (basic)
 PHP_RSHUTDOWN_FUNCTION (basic)
 PHP_MINFO_FUNCTION (basic)
 PHP_FUNCTION (constant)
 PHP_FUNCTION (sleep)
 PHP_FUNCTION (usleep)
 PHP_FUNCTION (flush)
 PHP_FUNCTION (ip2long)
 PHP_FUNCTION (long2ip)
 PHP_FUNCTION (getenv)
 PHP_FUNCTION (putenv)
 PHP_FUNCTION (getopt)
 PHP_FUNCTION (get_current_user)
 PHP_FUNCTION (set_time_limit)
 PHP_FUNCTION (get_cfg_var)
 PHP_FUNCTION (set_magic_quotes_runtime)
 PHP_FUNCTION (get_magic_quotes_runtime)
 PHP_FUNCTION (get_magic_quotes_gpc)
 PHP_FUNCTION (import_request_variables)
 PHP_FUNCTION (error_log)
 PHP_FUNCTION (error_get_last)
 PHP_FUNCTION (call_user_func)
 PHP_FUNCTION (call_user_func_array)
 PHP_FUNCTION (call_user_method)
 PHP_FUNCTION (call_user_method_array)
 PHP_FUNCTION (forward_static_call)
 PHP_FUNCTION (forward_static_call_array)
 PHP_FUNCTION (register_shutdown_function)
 PHP_FUNCTION (highlight_file)
 PHP_FUNCTION (highlight_string)
 PHP_FUNCTION (php_strip_whitespace)
ZEND_API void php_get_highlight_struct (zend_syntax_highlighter_ini *syntax_highlighter_ini)
 PHP_FUNCTION (ini_get)
 PHP_FUNCTION (ini_get_all)
 PHP_FUNCTION (ini_set)
 PHP_FUNCTION (ini_restore)
 PHP_FUNCTION (get_include_path)
 PHP_FUNCTION (set_include_path)
 PHP_FUNCTION (restore_include_path)
 PHP_FUNCTION (print_r)
 PHP_FUNCTION (fprintf)
 PHP_FUNCTION (vfprintf)
 PHP_FUNCTION (connection_aborted)
 PHP_FUNCTION (connection_status)
 PHP_FUNCTION (ignore_user_abort)
 PHP_FUNCTION (getservbyname)
 PHP_FUNCTION (getservbyport)
 PHP_FUNCTION (getprotobyname)
 PHP_FUNCTION (getprotobynumber)
 PHP_NAMED_FUNCTION (php_if_crc32)
 PHP_FUNCTION (register_tick_function)
 PHP_FUNCTION (unregister_tick_function)
 PHP_FUNCTION (is_uploaded_file)
 PHP_FUNCTION (move_uploaded_file)
 PHP_FUNCTION (parse_ini_file)
 PHP_FUNCTION (parse_ini_string)
 PHP_FUNCTION (str_rot13)
 PHP_FUNCTION (stream_get_filters)
 PHP_FUNCTION (stream_filter_register)
 PHP_FUNCTION (stream_bucket_make_writeable)
 PHP_FUNCTION (stream_bucket_prepend)
 PHP_FUNCTION (stream_bucket_append)
 PHP_FUNCTION (stream_bucket_new)
 PHP_MINIT_FUNCTION (user_filters)
 PHP_RSHUTDOWN_FUNCTION (user_filters)
 PHP_RSHUTDOWN_FUNCTION (browscap)
PHPAPI int _php_error_log (int opt_err, char *message, char *opt, char *headers TSRMLS_DC)
PHPAPI int _php_error_log_ex (int opt_err, char *message, int message_len, char *opt, char *headers TSRMLS_DC)
PHPAPI int php_prefix_varname (zval *result, zval *prefix, char *var_name, int var_name_len, zend_bool add_underscore TSRMLS_DC)
PHPAPI double php_get_nan (void)
PHPAPI double php_get_inf (void)

Variables

zend_module_entry basic_functions_module
PHPAPI php_basic_globals basic_globals

Class Documentation

struct _php_basic_globals

Definition at line 164 of file basic_functions.h.

Collaboration diagram for _php_basic_globals:
Class Members
zval * active_ini_file_section
zend_fcall_info array_walk_fci
zend_fcall_info_cache array_walk_fci_cache
char * CurrentLStatFile
char * CurrentStatFile
zend_class_entry * incomplete_class
int left
char * locale_string
php_stream_statbuf lssb
zend_bool mt_rand_is_seeded
php_uint32 * next
long page_gid
long page_inode
time_t page_mtime
long page_uid
HashTable putenv_ht
zend_bool rand_is_seeded
unsigned int rand_seed
char * sm_allowed_env_vars
HashTable sm_protected_env_vars
php_stream_statbuf ssb
php_uint32 state
char str_ebuf
char * strtok_last
ulong strtok_len
char * strtok_string
char strtok_table
zval * strtok_zval
char * syslog_device
int syslog_started
int umask
url_adapt_state_ex_t url_adapt_state_ex
zend_fcall_info user_compare_fci
zend_fcall_info_cache user_compare_fci_cache
HashTable * user_filter_map
HashTable * user_shutdown_function_names
zend_llist * user_tick_functions

Define Documentation

Definition at line 38 of file basic_functions.h.

#define BG (   v)    (basic_globals.v)

Definition at line 234 of file basic_functions.h.

#define MT_N   (624)

Definition at line 162 of file basic_functions.h.

#define SAFE_MODE_ALLOWED_ENV_VARS   "PHP_"

Definition at line 250 of file basic_functions.h.

#define SAFE_MODE_PROTECTED_ENV_VARS   "LD_LIBRARY_PATH"

Definition at line 249 of file basic_functions.h.


Typedef Documentation


Function Documentation

PHPAPI int _php_error_log ( int  opt_err,
char *  message,
char *  opt,
char *headers  TSRMLS_DC 
)

Definition at line 4698 of file basic_functions.c.

{
       return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC);
}

Here is the call graph for this function:

PHPAPI int _php_error_log_ex ( int  opt_err,
char *  message,
int  message_len,
char *  opt,
char *headers  TSRMLS_DC 
)

Definition at line 4704 of file basic_functions.c.

{
       php_stream *stream = NULL;

       switch (opt_err)
       {
              case 1:              /*send an email */
                     if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) {
                            return FAILURE;
                     }
                     break;

              case 2:              /*send to an address */
                     php_error_docref(NULL TSRMLS_CC, E_WARNING, "TCP/IP option not available!");
                     return FAILURE;
                     break;

              case 3:              /*save to a file */
                     stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL);
                     if (!stream) {
                            return FAILURE;
                     }
                     php_stream_write(stream, message, message_len);
                     php_stream_close(stream);
                     break;

              case 4: /* send to SAPI */
                     if (sapi_module.log_message) {
                            sapi_module.log_message(message);
                     } else {
                            return FAILURE;
                     }
                     break;

              default:
                     php_log_err(message TSRMLS_CC);
                     break;
       }
       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHP_FUNCTION ( constant  )

Definition at line 3826 of file basic_functions.c.

{
       char *const_name;
       int const_name_len;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &const_name, &const_name_len) == FAILURE) {
              return;
       }

       if (!zend_get_constant_ex(const_name, const_name_len, return_value, NULL, ZEND_FETCH_CLASS_SILENT TSRMLS_CC)) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find constant %s", const_name);
              RETURN_NULL();
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( sleep  )

Definition at line 4447 of file basic_functions.c.

{
       long num;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
              RETURN_FALSE;
       }
       if (num < 0) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of seconds must be greater than or equal to 0");
              RETURN_FALSE;
       }
#ifdef PHP_SLEEP_NON_VOID
       RETURN_LONG(php_sleep(num));
#else
       php_sleep(num);
#endif

}

Here is the call graph for this function:

Definition at line 4469 of file basic_functions.c.

{
#if HAVE_USLEEP
       long num;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &num) == FAILURE) {
              return;
       }
       if (num < 0) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0");
              RETURN_FALSE;
       }
       usleep(num);
#endif
}

Here is the call graph for this function:

PHP_FUNCTION ( flush  )

Definition at line 4439 of file basic_functions.c.

Here is the call graph for this function:

PHP_FUNCTION ( ip2long  )

Definition at line 3915 of file basic_functions.c.

{
       char *addr;
       int addr_len;
#ifdef HAVE_INET_PTON
       struct in_addr ip;
#else
       unsigned long int ip;
#endif

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &addr, &addr_len) == FAILURE) {
              return;
       }

#ifdef HAVE_INET_PTON
       if (addr_len == 0 || inet_pton(AF_INET, addr, &ip) != 1) {
              RETURN_FALSE;
       }
       RETURN_LONG(ntohl(ip.s_addr));
#else
       if (addr_len == 0 || (ip = inet_addr(addr)) == INADDR_NONE) {
              /* The only special case when we should return -1 ourselves,
               * because inet_addr() considers it wrong. We return 0xFFFFFFFF and
               * 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)
              ) {
                     RETURN_LONG(0xFFFFFFFF);
              }
              RETURN_FALSE;
       }
       RETURN_LONG(ntohl(ip));
#endif
}

Here is the call graph for this function:

PHP_FUNCTION ( long2ip  )

Definition at line 3953 of file basic_functions.c.

{
       /* "It's a long but it's not, PHP ints are signed */
       char *ip;
       int ip_len;
       unsigned long n;
       struct in_addr myaddr;
#ifdef HAVE_INET_PTON
       char str[40];
#endif

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ip, &ip_len) == FAILURE) {
              return;
       }

       n = strtoul(ip, NULL, 0);

       myaddr.s_addr = htonl(n);
#ifdef HAVE_INET_PTON
       if (inet_ntop(AF_INET, &myaddr, str, sizeof(str))) {
              RETURN_STRING(str, 1);
       } else {
              RETURN_FALSE;
       }
#else
       RETURN_STRING(inet_ntoa(myaddr), 1);
#endif
}

Here is the call graph for this function:

PHP_FUNCTION ( getenv  )

Definition at line 3989 of file basic_functions.c.

{
       char *ptr, *str;
       int str_len;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
              RETURN_FALSE;
       }

       /* SAPI method returns an emalloc()'d string */
       ptr = sapi_getenv(str, str_len TSRMLS_CC);
       if (ptr) {
              RETURN_STRING(ptr, 0);
       }
#ifdef PHP_WIN32
       {
              char dummybuf;
              int size;

              SetLastError(0);
              /*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 
              null character. We use this return value to alloc the final buffer. */
              size = GetEnvironmentVariableA(str, &dummybuf, 0);
              if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
                            /* The environment variable doesn't exist. */
                            RETURN_FALSE;
              }

              if (size == 0) {
                            /* env exists, but it is empty */
                            RETURN_EMPTY_STRING();
              }

              ptr = emalloc(size);
              size = GetEnvironmentVariableA(str, ptr, size);
              if (size == 0) {
                            /* has been removed between the two calls */
                            efree(ptr);
                            RETURN_EMPTY_STRING();
              } else {
                     RETURN_STRING(ptr, 0);
              }
       }
#else
       /* system method returns a const */
       ptr = getenv(str);
       if (ptr) {
              RETURN_STRING(ptr, 1);
       }
#endif
       RETURN_FALSE;
}

Here is the call graph for this function:

PHP_FUNCTION ( putenv  )
PHP_FUNCTION ( getopt  )

Definition at line 4248 of file basic_functions.c.

{
       char *options = NULL, **argv = NULL;
       char opt[2] = { '\0' };
       char *optname;
       int argc = 0, options_len = 0, len, o;
       char *php_optarg = NULL;
       int php_optind = 1;
       zval *val, **args = NULL, *p_longopts = NULL;
       int optname_len = 0;
       opt_struct *opts, *orig_opts;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &options, &options_len, &p_longopts) == FAILURE) {
              RETURN_FALSE;
       }

       /* Get argv from the global symbol table. We calculate argc ourselves
        * in order to be on the safe side, even though it is also available
        * from the symbol table. */
       if (PG(http_globals)[TRACK_VARS_SERVER] &&
              (zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), (void **) &args) != FAILURE ||
              zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void **) &args) != FAILURE) && Z_TYPE_PP(args) == IS_ARRAY
       ) {
              int pos = 0;
              zval **entry;

              argc = zend_hash_num_elements(Z_ARRVAL_PP(args));

              /* Attempt to allocate enough memory to hold all of the arguments
               * and a trailing NULL */
              argv = (char **) safe_emalloc(sizeof(char *), (argc + 1), 0);

              /* Reset the array indexes. */
              zend_hash_internal_pointer_reset(Z_ARRVAL_PP(args));

              /* Iterate over the hash to construct the argv array. */
              while (zend_hash_get_current_data(Z_ARRVAL_PP(args), (void **)&entry) == SUCCESS) {
                     zval arg, *arg_ptr = *entry;

                     if (Z_TYPE_PP(entry) != IS_STRING) {
                            arg = **entry;
                            zval_copy_ctor(&arg);
                            convert_to_string(&arg);
                            arg_ptr = &arg;
                     }

                     argv[pos++] = estrdup(Z_STRVAL_P(arg_ptr));

                     if (arg_ptr != *entry) {
                            zval_dtor(&arg);
                     }

                     zend_hash_move_forward(Z_ARRVAL_PP(args));
              }

              /* The C Standard requires argv[argc] to be NULL - this might
               * keep some getopt implementations happy. */
              argv[argc] = NULL;
       } else {
              /* Return false if we can't find argv. */
              RETURN_FALSE;
       }

       len = parse_opts(options, &opts);

       if (p_longopts) {
              int count;
              zval **entry;

              count = zend_hash_num_elements(Z_ARRVAL_P(p_longopts));

              /* 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));

              /* Reset the array indexes. */
              zend_hash_internal_pointer_reset(Z_ARRVAL_P(p_longopts));

              /* Iterate over the hash to construct the argv array. */
              while (zend_hash_get_current_data(Z_ARRVAL_P(p_longopts), (void **)&entry) == SUCCESS) {
                     zval arg, *arg_ptr = *entry;

                     if (Z_TYPE_PP(entry) != IS_STRING) {
                            arg = **entry;
                            zval_copy_ctor(&arg);
                            convert_to_string(&arg);
                            arg_ptr = &arg;
                     }

                     opts->need_param = 0;
                     opts->opt_name = estrdup(Z_STRVAL_P(arg_ptr));
                     len = strlen(opts->opt_name);
                     if ((len > 0) && (opts->opt_name[len - 1] == ':')) {
                            opts->need_param++;
                            opts->opt_name[len - 1] = '\0';
                            if ((len > 1) && (opts->opt_name[len - 2] == ':')) {
                                   opts->need_param++;
                                   opts->opt_name[len - 2] = '\0';
                            }
                     }
                     opts->opt_char = 0;
                     opts++;

                     if (arg_ptr != *entry) {
                            zval_dtor(&arg);
                     }

                     zend_hash_move_forward(Z_ARRVAL_P(p_longopts));
              }
       } else {
              opts = (opt_struct*) erealloc(opts, sizeof(opt_struct) * (len + 1));
              orig_opts = opts;
              opts += len;
       }

       /* php_getopt want to identify the last param */
       opts->opt_char   = '-';
       opts->need_param = 0;
       opts->opt_name   = NULL;

       /* Initialize the return value as an array. */
       array_init(return_value);

       /* after our pointer arithmetic jump back to the first element */
       opts = orig_opts;

       while ((o = php_getopt(argc, argv, opts, &php_optarg, &php_optind, 0, 1)) != -1) {
              /* Skip unknown arguments. */
              if (o == '?') {
                     continue;
              }

              /* Prepare the option character and the argument string. */
              if (o == 0) {
                     optname = opts[php_optidx].opt_name;
              } else {
                     if (o == 1) {
                            o = '-';
                     }
                     opt[0] = o;
                     optname = opt;
              }

              MAKE_STD_ZVAL(val);
              if (php_optarg != NULL) {
                     /* keep the arg as binary, since the encoding is not known */
                     ZVAL_STRING(val, php_optarg, 1);
              } else {
                     ZVAL_FALSE(val);
              }

              /* Add this option / argument pair to the result hash. */
              optname_len = strlen(optname);
              if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) {
                     /* numeric string */
                     int optname_int = atoi(optname);
                     if (zend_hash_index_find(HASH_OF(return_value), optname_int, (void **)&args) != FAILURE) {
                            if (Z_TYPE_PP(args) != IS_ARRAY) {
                                   convert_to_array_ex(args);
                            }
                            zend_hash_next_index_insert(HASH_OF(*args), (void *)&val, sizeof(zval *), NULL);
                     } else {
                            zend_hash_index_update(HASH_OF(return_value), optname_int, &val, sizeof(zval *), NULL);
                     }
              } else {
                     /* other strings */
                     if (zend_hash_find(HASH_OF(return_value), optname, strlen(optname)+1, (void **)&args) != FAILURE) {
                            if (Z_TYPE_PP(args) != IS_ARRAY) {
                                   convert_to_array_ex(args);
                            }
                            zend_hash_next_index_insert(HASH_OF(*args), (void *)&val, sizeof(zval *), NULL);
                     } else {
                            zend_hash_add(HASH_OF(return_value), optname, strlen(optname)+1, (void *)&val, sizeof(zval *), NULL);
                     }
              }

              php_optarg = NULL;
       }

       free_longopts(orig_opts);
       efree(orig_opts);
       free_argv(argv, argc);
}

Here is the call graph for this function:

PHP_FUNCTION ( get_current_user  )

Definition at line 4560 of file basic_functions.c.

Here is the call graph for this function:

PHP_FUNCTION ( set_time_limit  )

Definition at line 1149 of file main.c.

{
       long new_timeout;
       char *new_timeout_str;
       int new_timeout_strlen;

       if (PG(safe_mode)) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot set time limit in safe mode");
              RETURN_FALSE;
       }

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_timeout) == FAILURE) {
              return;
       }
       
       new_timeout_strlen = zend_spprintf(&new_timeout_str, 0, "%ld", new_timeout);

       if (zend_alter_ini_entry_ex("max_execution_time", sizeof("max_execution_time"), new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) {
              RETVAL_TRUE;
       } else {
              RETVAL_FALSE;
       }
       efree(new_timeout_str);
}

Here is the call graph for this function:

PHP_FUNCTION ( get_cfg_var  )

Definition at line 4595 of file basic_functions.c.

{
       char *varname;
       int varname_len;
       zval *retval;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
              return;
       }

       retval = cfg_get_entry(varname, varname_len + 1);

       if (retval) {
              if (Z_TYPE_P(retval) == IS_ARRAY) {
                     array_init(return_value);
                     zend_hash_apply_with_arguments(Z_ARRVAL_P(retval) TSRMLS_CC, (apply_func_args_t) add_config_entry_cb, 1, return_value);
                     return;
              } else {
                     RETURN_STRING(Z_STRVAL_P(retval), 1);
              }
       } else {
              RETURN_FALSE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( set_magic_quotes_runtime  )

Definition at line 4623 of file basic_functions.c.

{
       zend_bool new_setting;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &new_setting) == FAILURE) {
              return;
       }

       PG(magic_quotes_runtime) = new_setting;
       RETURN_TRUE;
}

Here is the call graph for this function:

PHP_FUNCTION ( get_magic_quotes_runtime  )

Definition at line 4638 of file basic_functions.c.

{
       RETURN_LONG(PG(magic_quotes_runtime));
}
PHP_FUNCTION ( get_magic_quotes_gpc  )

Definition at line 4646 of file basic_functions.c.

{
       RETURN_LONG(PG(magic_quotes_gpc));
}
PHP_FUNCTION ( import_request_variables  )

Definition at line 6126 of file basic_functions.c.

{
       char *types;
       int types_len;
       zval *prefix = NULL;
       char *p;
       zend_bool ok = 0;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &types, &types_len, &prefix) == FAILURE) {
              return;
       }

       if (ZEND_NUM_ARGS() > 1) {
              convert_to_string(prefix);

              if (Z_STRLEN_P(prefix) == 0) {
                     php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard");
              }
       } else {
              MAKE_STD_ZVAL(prefix);
              ZVAL_EMPTY_STRING(prefix);
       }

       for (p = types; p && *p; p++) {
              switch (*p) {

                     case 'g':
                     case 'G':
                            zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
                            ok = 1;
                            break;

                     case 'p':
                     case 'P':
                            zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
                            zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_FILES]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
                            ok = 1;
                            break;

                     case 'c':
                     case 'C':
                            zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
                            ok = 1;
                            break;
              }
       }

       if (ZEND_NUM_ARGS() < 2) {
              zval_ptr_dtor(&prefix);
       }
       RETURN_BOOL(ok);
}

Here is the call graph for this function:

PHP_FUNCTION ( error_log  )

Definition at line 4668 of file basic_functions.c.

{
       char *message, *opt = NULL, *headers = NULL;
       int message_len, opt_len = 0, headers_len = 0;
       int opt_err = 0, argc = ZEND_NUM_ARGS();
       long erropt = 0;

       if (zend_parse_parameters(argc TSRMLS_CC, "s|lss", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
              return;
       }

       if (argc > 1) {
              opt_err = erropt;
       }

       if (opt_err == 3 && opt) {
              if (strlen(opt) != opt_len) {
                     RETURN_FALSE;
              }
       }

       if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) {
              RETURN_FALSE;
       }

       RETURN_TRUE;
}

Here is the call graph for this function:

PHP_FUNCTION ( error_get_last  )

Definition at line 4748 of file basic_functions.c.

{
       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
              return;
       }

       if (PG(last_error_message)) {
              array_init(return_value);
              add_assoc_long_ex(return_value, "type", sizeof("type"), PG(last_error_type));
              add_assoc_string_ex(return_value, "message", sizeof("message"), PG(last_error_message), 1);
              add_assoc_string_ex(return_value, "file", sizeof("file"), PG(last_error_file)?PG(last_error_file):"-", 1 );
              add_assoc_long_ex(return_value, "line", sizeof("line"), PG(last_error_lineno));
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( call_user_func  )

Definition at line 4766 of file basic_functions.c.

{
       zval *retval_ptr = NULL;
       zend_fcall_info fci;
       zend_fcall_info_cache fci_cache;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
              return;
       }

       fci.retval_ptr_ptr = &retval_ptr;

       if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
              COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
       }

       if (fci.params) {
              efree(fci.params);
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( call_user_func_array  )

Definition at line 4790 of file basic_functions.c.

{
       zval *params, *retval_ptr = NULL;
       zend_fcall_info fci;
       zend_fcall_info_cache fci_cache;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
              return;
       }

       zend_fcall_info_args(&fci, params TSRMLS_CC);
       fci.retval_ptr_ptr = &retval_ptr;

       if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
              COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
       }

       zend_fcall_info_args_clear(&fci, 1);
}

Here is the call graph for this function:

PHP_FUNCTION ( call_user_method  )

Definition at line 4813 of file basic_functions.c.

{
       zval ***params = NULL;
       int n_params = 0;
       zval *retval_ptr;
       zval *callback, *object;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z*", &callback, &object, &params, &n_params) == FAILURE) {
              return;
       }

       if (Z_TYPE_P(object) != IS_OBJECT &&
              Z_TYPE_P(object) != IS_STRING
       ) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
              if (params) {
                     efree(params);
              }
              RETURN_FALSE;
       }

       convert_to_string(callback);

       if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
              if (retval_ptr) {
                     COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
              }
       } else {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
       }
       if (n_params) {
              efree(params);
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( call_user_method_array  )

Definition at line 4851 of file basic_functions.c.

{
       zval *params, ***method_args = NULL, *retval_ptr;
       zval *callback, *object;
       HashTable *params_ar;
       int num_elems, element = 0;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, &params) == FAILURE) {
              return;
       }

       if (Z_TYPE_P(object) != IS_OBJECT &&
              Z_TYPE_P(object) != IS_STRING
       ) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
              RETURN_FALSE;
       }

       convert_to_string(callback);

       params_ar = HASH_OF(params);
       num_elems = zend_hash_num_elements(params_ar);
       method_args = (zval ***) safe_emalloc(sizeof(zval **), num_elems, 0);

       for (zend_hash_internal_pointer_reset(params_ar);
              zend_hash_get_current_data(params_ar, (void **) &(method_args[element])) == SUCCESS;
              zend_hash_move_forward(params_ar)
       ) {
              element++;
       }

       if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) {
              if (retval_ptr) {
                     COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
              }
       } else {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
       }

       efree(method_args);
}

Here is the call graph for this function:

PHP_FUNCTION ( forward_static_call  )

Definition at line 4896 of file basic_functions.c.

{
       zval *retval_ptr = NULL;
       zend_fcall_info fci;
       zend_fcall_info_cache fci_cache;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
              return;
       }

       if (!EG(active_op_array)->scope) {
              zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active");
       }

       fci.retval_ptr_ptr = &retval_ptr;

       if (EG(called_scope) &&
              instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
                     fci_cache.called_scope = EG(called_scope);
       }
       
       if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
              COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
       }

       if (fci.params) {
              efree(fci.params);
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( forward_static_call_array  )

Definition at line 4929 of file basic_functions.c.

{
       zval *params, *retval_ptr = NULL;
       zend_fcall_info fci;
       zend_fcall_info_cache fci_cache;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "fa/", &fci, &fci_cache, &params) == FAILURE) {
              return;
       }

       zend_fcall_info_args(&fci, params TSRMLS_CC);
       fci.retval_ptr_ptr = &retval_ptr;

       if (EG(called_scope) &&
              instanceof_function(EG(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
                     fci_cache.called_scope = EG(called_scope);
       }

       if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) {
              COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr);
       }

       zend_fcall_info_args_clear(&fci, 1);
}

Here is the call graph for this function:

PHP_FUNCTION ( register_shutdown_function  )

Definition at line 5107 of file basic_functions.c.

{
       php_shutdown_function_entry shutdown_function_entry;
       char *function_name = NULL;
       int i;

       shutdown_function_entry.arg_count = ZEND_NUM_ARGS();

       if (shutdown_function_entry.arg_count < 1) {
              WRONG_PARAM_COUNT;
       }

       shutdown_function_entry.arguments = (zval **) safe_emalloc(sizeof(zval *), shutdown_function_entry.arg_count, 0);

       if (zend_get_parameters_array(ht, shutdown_function_entry.arg_count, shutdown_function_entry.arguments) == FAILURE) {
              efree(shutdown_function_entry.arguments);
              RETURN_FALSE;
       }

       /* Prevent entering of anything but valid callback (syntax check only!) */
       if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &function_name TSRMLS_CC)) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%s' passed", function_name);
              efree(shutdown_function_entry.arguments);
              RETVAL_FALSE;
       } else {
              if (!BG(user_shutdown_function_names)) {
                     ALLOC_HASHTABLE(BG(user_shutdown_function_names));
                     zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *)) user_shutdown_function_dtor, 0);
              }

              for (i = 0; i < shutdown_function_entry.arg_count; i++) {
                     Z_ADDREF_P(shutdown_function_entry.arguments[i]);
              }
              zend_hash_next_index_insert(BG(user_shutdown_function_names), &shutdown_function_entry, sizeof(php_shutdown_function_entry), NULL);
       }
       if (function_name) {
              efree(function_name);
       }
}

Here is the call graph for this function:

Definition at line 5160 of file basic_functions.c.

{
       char *filename;
       int filename_len;
       zend_syntax_highlighter_ini syntax_highlighter_ini;
       zend_bool i = 0;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) {
              RETURN_FALSE;
       }

       if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
              RETURN_FALSE;
       }

       if (php_check_open_basedir(filename TSRMLS_CC)) {
              RETURN_FALSE;
       }

       if (strlen(filename) != filename_len) {
              RETURN_FALSE;
       }

       if (i) {
              php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
       }

       php_get_highlight_struct(&syntax_highlighter_ini);

       if (highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC) == FAILURE) {
              if (i) {
                     int res = php_ob_get_buffer(return_value TSRMLS_CC);

                     /* flush the buffer only if there is something to flush */
                     if (res == SUCCESS && Z_STRLEN_P(return_value) > 0) {
                            php_end_ob_buffer (1, 0 TSRMLS_CC);
                            zval_dtor(return_value);
                     } else {
                            php_end_ob_buffer (0, 0 TSRMLS_CC);
                            if (res == SUCCESS) {
                                   zval_dtor(return_value);
                            }
                     }
              }
              RETURN_FALSE;
       }

       if (i) {
              php_ob_get_buffer (return_value TSRMLS_CC);
              php_end_ob_buffer (0, 0 TSRMLS_CC);
       } else {
              RETURN_TRUE;
       }
}

Here is the call graph for this function:

Definition at line 5257 of file basic_functions.c.

{
       zval **expr;
       zend_syntax_highlighter_ini syntax_highlighter_ini;
       char *hicompiled_string_description;
       zend_bool i = 0;
       int old_error_reporting = EG(error_reporting);

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) {
              RETURN_FALSE;
       }
       convert_to_string_ex(expr);

       if (i) {
              php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
       }

       EG(error_reporting) = E_ERROR;

       php_get_highlight_struct(&syntax_highlighter_ini);

       hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC);

       if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) {
              efree(hicompiled_string_description);
              EG(error_reporting) = old_error_reporting;
              if (i) {
                     php_end_ob_buffer (1, 0 TSRMLS_CC);
              }
              RETURN_FALSE;
       }
       efree(hicompiled_string_description);

       EG(error_reporting) = old_error_reporting;

       if (i) {
              php_ob_get_buffer (return_value TSRMLS_CC);
              php_end_ob_buffer (0, 0 TSRMLS_CC);
       } else {
              RETURN_TRUE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( php_strip_whitespace  )

Definition at line 5218 of file basic_functions.c.

{
       char *filename;
       int filename_len;
       zend_lex_state original_lex_state;
       zend_file_handle file_handle = {0};

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
              RETURN_FALSE;
       }

       if (strlen(filename) != filename_len) {
              RETURN_FALSE;
       }

       file_handle.type = ZEND_HANDLE_FILENAME;
       file_handle.filename = filename;
       file_handle.free_filename = 0;
       file_handle.opened_path = NULL;
       zend_save_lexical_state(&original_lex_state TSRMLS_CC);
       if (open_file_for_scanning(&file_handle TSRMLS_CC)==FAILURE) {
              zend_restore_lexical_state(&original_lex_state TSRMLS_CC);
              RETURN_EMPTY_STRING();
       }

       php_start_ob_buffer(NULL, 0, 1 TSRMLS_CC);

       zend_strip(TSRMLS_C);

       zend_destroy_file_handle(&file_handle TSRMLS_CC);
       zend_restore_lexical_state(&original_lex_state TSRMLS_CC);

       php_ob_get_buffer(return_value TSRMLS_CC);
       php_end_ob_buffer(0, 0 TSRMLS_CC);
}

Here is the call graph for this function:

PHP_FUNCTION ( ini_get  )

Definition at line 5303 of file basic_functions.c.

{
       char *varname, *str;
       int varname_len;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
              return;
       }

       str = zend_ini_string(varname, varname_len + 1, 0);

       if (!str) {
              RETURN_FALSE;
       }

       RETURN_STRING(str, 1);
}

Here is the call graph for this function:

PHP_FUNCTION ( ini_get_all  )

Definition at line 5371 of file basic_functions.c.

{
       char *extname = NULL;
       int extname_len = 0, extnumber = 0;
       zend_module_entry *module;
       zend_bool details = 1;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!b", &extname, &extname_len, &details) == FAILURE) {
              return;
       }

       zend_ini_sort_entries(TSRMLS_C);

       if (extname) {
              if (zend_hash_find(&module_registry, extname, extname_len+1, (void **) &module) == FAILURE) {
                     php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find extension '%s'", extname);
                     RETURN_FALSE;
              }
              extnumber = module->module_number;
       }

       array_init(return_value);
       zend_hash_apply_with_arguments(EG(ini_directives) TSRMLS_CC, (apply_func_args_t) php_ini_get_option, 2, return_value, extnumber, details);
}

Here is the call graph for this function:

PHP_FUNCTION ( ini_set  )

Definition at line 5409 of file basic_functions.c.

{
       char *varname, *new_value;
       int varname_len, new_value_len;
       char *old_value;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &varname, &varname_len, &new_value, &new_value_len) == FAILURE) {
              return;
       }

       old_value = zend_ini_string(varname, varname_len + 1, 0);

       /* copy to return here, because alter might free it! */
       if (old_value) {
              RETVAL_STRING(old_value, 1);
       } else {
              RETVAL_FALSE;
       }

#define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini))
       /* safe_mode & basedir check */
       if (PG(safe_mode) || PG(open_basedir)) {
              if (_CHECK_PATH(varname, varname_len, "error_log") ||
                     _CHECK_PATH(varname, varname_len, "java.class.path") ||
                     _CHECK_PATH(varname, varname_len, "java.home") ||
                     _CHECK_PATH(varname, varname_len, "mail.log") ||
                     _CHECK_PATH(varname, varname_len, "java.library.path") ||
                     _CHECK_PATH(varname, varname_len, "vpopmail.directory")) {
                     if (PG(safe_mode) && (!php_checkuid(new_value, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
                            zval_dtor(return_value);
                            RETURN_FALSE;
                     }
                     if (php_check_open_basedir(new_value TSRMLS_CC)) {
                            zval_dtor(return_value);
                            RETURN_FALSE;
                     }
              }
       }

       /* checks that ensure the user does not overwrite certain ini settings when safe_mode is enabled */
       if (PG(safe_mode)) {
              if (!strncmp("max_execution_time", varname, sizeof("max_execution_time")) ||
                     !strncmp("memory_limit", varname, sizeof("memory_limit")) ||
                     !strncmp("child_terminate", varname, sizeof("child_terminate"))
              ) {
                     zval_dtor(return_value);
                     RETURN_FALSE;
              }
       }

       if (zend_alter_ini_entry_ex(varname, varname_len + 1, new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
              zval_dtor(return_value);
              RETURN_FALSE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( ini_restore  )

Definition at line 5468 of file basic_functions.c.

{
       char *varname;
       int varname_len;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &varname, &varname_len) == FAILURE) {
              return;
       }

       zend_restore_ini_entry(varname, varname_len+1, PHP_INI_STAGE_RUNTIME);
}

Here is the call graph for this function:

PHP_FUNCTION ( get_include_path  )

Definition at line 5515 of file basic_functions.c.

{
       char *str;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
              return;
       }

       str = zend_ini_string("include_path", sizeof("include_path"), 0);

       if (str == NULL) {
              RETURN_FALSE;
       }

       RETURN_STRING(str, 1);
}

Here is the call graph for this function:

PHP_FUNCTION ( set_include_path  )

Definition at line 5483 of file basic_functions.c.

{
       char *new_value;
       int new_value_len;
       char *old_value;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_value, &new_value_len) == FAILURE) {
              return;
       }

       /* No nulls allowed in paths */
       if (strlen(new_value) != new_value_len) {
              RETURN_FALSE;
       }

       old_value = zend_ini_string("include_path", sizeof("include_path"), 0);
       /* copy to return here, because alter might free it! */
       if (old_value) {
              RETVAL_STRING(old_value, 1);
       } else {
              RETVAL_FALSE;
       }

       if (zend_alter_ini_entry_ex("include_path", sizeof("include_path"), new_value, new_value_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == FAILURE) {
              zval_dtor(return_value);
              RETURN_FALSE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( restore_include_path  )

Definition at line 5535 of file basic_functions.c.

{
       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
              return;
       }
       zend_restore_ini_entry("include_path", sizeof("include_path"), PHP_INI_STAGE_RUNTIME);
}

Here is the call graph for this function:

PHP_FUNCTION ( print_r  )

Definition at line 5546 of file basic_functions.c.

{
       zval *var;
       zend_bool do_return = 0;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &var, &do_return) == FAILURE) {
              RETURN_FALSE;
       }

       if (do_return) {
              php_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
       }

       zend_print_zval_r(var, 0 TSRMLS_CC);

       if (do_return) {
              php_ob_get_buffer (return_value TSRMLS_CC);
              php_end_ob_buffer (0, 0 TSRMLS_CC);
       } else {
              RETURN_TRUE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( fprintf  )

Definition at line 729 of file formatted_print.c.

{
       php_stream *stream;
       zval *arg1;
       char *result;
       int len;
       
       if (ZEND_NUM_ARGS() < 2) {
              WRONG_PARAM_COUNT;
       }
       
       if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
              RETURN_FALSE;
       }
       
       php_stream_from_zval(stream, &arg1);

       if ((result=php_formatted_print(ht, &len, 0, 1 TSRMLS_CC))==NULL) {
              RETURN_FALSE;
       }

       php_stream_write(stream, result, len);

       efree(result);

       RETURN_LONG(len);
}

Here is the call graph for this function:

PHP_FUNCTION ( vfprintf  )

Definition at line 760 of file formatted_print.c.

{
       php_stream *stream;
       zval *arg1;
       char *result;
       int len;
       
       if (ZEND_NUM_ARGS() != 3) {
              WRONG_PARAM_COUNT;
       }
       
       if (zend_parse_parameters(1 TSRMLS_CC, "r", &arg1) == FAILURE) {
              RETURN_FALSE;
       }
       
       php_stream_from_zval(stream, &arg1);

       if ((result=php_formatted_print(ht, &len, 1, 1 TSRMLS_CC))==NULL) {
              RETURN_FALSE;
       }

       php_stream_write(stream, result, len);

       efree(result);

       RETURN_LONG(len);
}

Here is the call graph for this function:

PHP_FUNCTION ( connection_aborted  )

Definition at line 5572 of file basic_functions.c.

{
       RETURN_LONG(PG(connection_status) & PHP_CONNECTION_ABORTED);
}
PHP_FUNCTION ( connection_status  )

Definition at line 5580 of file basic_functions.c.

{
       RETURN_LONG(PG(connection_status));
}
PHP_FUNCTION ( ignore_user_abort  )

Definition at line 5588 of file basic_functions.c.

{
       char *arg = NULL;
       int arg_len = 0;
       int old_setting;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &arg, &arg_len) == FAILURE) {
              return;
       }

       old_setting = PG(ignore_user_abort);

       if (arg) {
              zend_alter_ini_entry_ex("ignore_user_abort", sizeof("ignore_user_abort"), arg, arg_len, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
       }

       RETURN_LONG(old_setting);
}

Here is the call graph for this function:

PHP_FUNCTION ( getservbyname  )
PHP_FUNCTION ( getservbyport  )
PHP_FUNCTION ( getprotobyname  )
PHP_FUNCTION ( getprotobynumber  )
PHP_FUNCTION ( register_tick_function  )

Definition at line 5715 of file basic_functions.c.

{
       user_tick_function_entry tick_fe;
       int i;
       char *function_name = NULL;

       tick_fe.calling = 0;
       tick_fe.arg_count = ZEND_NUM_ARGS();

       if (tick_fe.arg_count < 1) {
              WRONG_PARAM_COUNT;
       }

       tick_fe.arguments = (zval **) safe_emalloc(sizeof(zval *), tick_fe.arg_count, 0);

       if (zend_get_parameters_array(ht, tick_fe.arg_count, tick_fe.arguments) == FAILURE) {
              efree(tick_fe.arguments);
              RETURN_FALSE;
       }

       if (!zend_is_callable(tick_fe.arguments[0], 0, &function_name TSRMLS_CC)) {
              efree(tick_fe.arguments);
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid tick callback '%s' passed", function_name);
              efree(function_name);
              RETURN_FALSE;
       } else if (function_name) {
              efree(function_name);
       }

       if (Z_TYPE_P(tick_fe.arguments[0]) != IS_ARRAY && Z_TYPE_P(tick_fe.arguments[0]) != IS_OBJECT) {
              convert_to_string_ex(&tick_fe.arguments[0]);
       }

       if (!BG(user_tick_functions)) {
              BG(user_tick_functions) = (zend_llist *) emalloc(sizeof(zend_llist));
              zend_llist_init(BG(user_tick_functions),
                                          sizeof(user_tick_function_entry),
                                          (llist_dtor_func_t) user_tick_function_dtor, 0);
              php_add_tick_function(run_user_tick_functions);
       }

       for (i = 0; i < tick_fe.arg_count; i++) {
              Z_ADDREF_P(tick_fe.arguments[i]);
       }

       zend_llist_add_element(BG(user_tick_functions), &tick_fe);

       RETURN_TRUE;
}

Here is the call graph for this function:

PHP_FUNCTION ( unregister_tick_function  )

Definition at line 5768 of file basic_functions.c.

{
       zval *function;
       user_tick_function_entry tick_fe;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &function) == FAILURE) {
              return;
       }

       if (!BG(user_tick_functions)) {
              return;
       }

       if (Z_TYPE_P(function) != IS_ARRAY) {
              convert_to_string(function);
       }

       tick_fe.arguments = (zval **) emalloc(sizeof(zval *));
       tick_fe.arguments[0] = function;
       tick_fe.arg_count = 1;
       zend_llist_del_element(BG(user_tick_functions), &tick_fe, (int (*)(void *, void *)) user_tick_function_compare);
       efree(tick_fe.arguments);
}

Here is the call graph for this function:

PHP_FUNCTION ( is_uploaded_file  )

Definition at line 5795 of file basic_functions.c.

{
       char *path;
       int path_len;

       if (!SG(rfc1867_uploaded_files)) {
              RETURN_FALSE;
       }

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &path, &path_len) == FAILURE) {
              return;
       }

       if (strlen(path) != path_len) {
              RETURN_FALSE;
       }

       if (zend_hash_exists(SG(rfc1867_uploaded_files), path, path_len + 1)) {
              RETURN_TRUE;
       } else {
              RETURN_FALSE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( move_uploaded_file  )

Definition at line 5822 of file basic_functions.c.

{
       char *path, *new_path;
       int path_len, new_path_len;
       zend_bool successful = 0;

#ifndef PHP_WIN32
       int oldmask; int ret;
#endif

       if (!SG(rfc1867_uploaded_files)) {
              RETURN_FALSE;
       }

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
              return;
       }

       if (!zend_hash_exists(SG(rfc1867_uploaded_files), path, path_len + 1)) {
              RETURN_FALSE;
       }

       if (PG(safe_mode) && (!php_checkuid(new_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
              RETURN_FALSE;
       }

       if (php_check_open_basedir(new_path TSRMLS_CC)) {
              RETURN_FALSE;
       }

       if (strlen(path) != path_len) {
              RETURN_FALSE;
       }

       if (strlen(new_path) != new_path_len) {
              RETURN_FALSE;
       }

       if (VCWD_RENAME(path, new_path) == 0) {
              successful = 1;
#ifndef PHP_WIN32
              oldmask = umask(077);
              umask(oldmask);

              ret = VCWD_CHMOD(new_path, 0666 & ~oldmask);

              if (ret == -1) {
                     php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
              }
#endif
       } else if (php_copy_file_ex(path, new_path, STREAM_DISABLE_OPEN_BASEDIR TSRMLS_CC) == SUCCESS) {
              VCWD_UNLINK(path);
              successful = 1;
       }

       if (successful) {
              zend_hash_del(SG(rfc1867_uploaded_files), path, path_len + 1);
       } else {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to move '%s' to '%s'", path, new_path);
       }

       RETURN_BOOL(successful);
}

Here is the call graph for this function:

PHP_FUNCTION ( parse_ini_file  )

Definition at line 5984 of file basic_functions.c.

{
       char *filename = NULL;
       int filename_len = 0;
       zend_bool process_sections = 0;
       long scanner_mode = ZEND_INI_SCANNER_NORMAL;
       zend_file_handle fh;
       zend_ini_parser_cb_t ini_parser_cb;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
              RETURN_FALSE;
       }

       if (filename_len == 0) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename cannot be empty!");
              RETURN_FALSE;
       }

       if (strlen(filename) != filename_len) {
              RETURN_FALSE;
       }

       /* Set callback function */
       if (process_sections) {
              BG(active_ini_file_section) = NULL;
              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 filehandle */
       memset(&fh, 0, sizeof(fh));
       fh.filename = filename;
       fh.type = ZEND_HANDLE_FILENAME;

       array_init(return_value);
       if (zend_parse_ini_file(&fh, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
              zend_hash_destroy(Z_ARRVAL_P(return_value));
              efree(Z_ARRVAL_P(return_value));
              RETURN_FALSE;
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( parse_ini_string  )

Definition at line 6030 of file basic_functions.c.

{
       char *string = NULL, *str = NULL;
       int str_len = 0;
       zend_bool process_sections = 0;
       long scanner_mode = ZEND_INI_SCANNER_NORMAL;
       zend_ini_parser_cb_t ini_parser_cb;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
              RETURN_FALSE;
       }

       if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
              RETVAL_FALSE;
       }

       /* Set callback function */
       if (process_sections) {
              BG(active_ini_file_section) = NULL;
              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);
       if (zend_parse_ini_string(string, 0, scanner_mode, ini_parser_cb, return_value TSRMLS_CC) == FAILURE) {
              zend_hash_destroy(Z_ARRVAL_P(return_value));
              efree(Z_ARRVAL_P(return_value));
              RETVAL_FALSE;
       }
       efree(string);
}

Here is the call graph for this function:

PHP_FUNCTION ( str_rot13  )

Definition at line 5010 of file string.c.

{
       char *arg;
       int arglen;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arglen) == FAILURE) {
              return;
       }

       RETVAL_STRINGL(arg, arglen, 1);

       php_strtr(Z_STRVAL_P(return_value), Z_STRLEN_P(return_value), rot13_from, rot13_to, 52);
}

Here is the call graph for this function:

PHP_FUNCTION ( stream_get_filters  )

Definition at line 544 of file user_filters.c.

{
       char *filter_name;
       int key_flags, filter_name_len = 0;
       HashTable *filters_hash;
       ulong num_key;

       if (zend_parse_parameters_none() == FAILURE) {
              return;
       }

       array_init(return_value);

       filters_hash = php_get_stream_filters_hash();

       if (filters_hash) {
              for(zend_hash_internal_pointer_reset(filters_hash);
                     (key_flags = zend_hash_get_current_key_ex(filters_hash, &filter_name, &filter_name_len, &num_key, 0, NULL)) != HASH_KEY_NON_EXISTANT;
                     zend_hash_move_forward(filters_hash))
                            if (key_flags == HASH_KEY_IS_STRING) {
                                   add_next_index_stringl(return_value, filter_name, filter_name_len - 1, 1);
                            }
       }
       /* It's okay to return an empty array if no filters are registered */
}

Here is the call graph for this function:

PHP_FUNCTION ( stream_filter_register  )

Definition at line 573 of file user_filters.c.

{
       char *filtername, *classname;
       int filtername_len, classname_len;
       struct php_user_filter_data *fdat;
       
       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &filtername, &filtername_len,
                            &classname, &classname_len) == FAILURE) {
              RETURN_FALSE;
       }

       RETVAL_FALSE;

       if (!filtername_len) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty");
              return;
       }

       if (!classname_len) {
              php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty");
              return;
       }

       if (!BG(user_filter_map)) {
              BG(user_filter_map) = (HashTable*) emalloc(sizeof(HashTable));
              zend_hash_init(BG(user_filter_map), 5, NULL, (dtor_func_t) filter_item_dtor, 0);
       }

       fdat = ecalloc(1, sizeof(struct php_user_filter_data) + classname_len);
       memcpy(fdat->classname, classname, classname_len);

       if (zend_hash_add(BG(user_filter_map), filtername, filtername_len + 1, (void*)fdat,
                            sizeof(*fdat) + classname_len, NULL) == SUCCESS &&
                     php_stream_filter_register_factory_volatile(filtername, &user_filter_factory TSRMLS_CC) == SUCCESS) {
              RETVAL_TRUE;
       }

       efree(fdat);
}

Here is the call graph for this function:

PHP_FUNCTION ( stream_bucket_make_writeable  )

Definition at line 414 of file user_filters.c.

{
       zval *zbrigade, *zbucket;
       php_stream_bucket_brigade *brigade;
       php_stream_bucket *bucket;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zbrigade) == FAILURE) {
              RETURN_FALSE;
       }

       ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, &zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); 

       ZVAL_NULL(return_value);

       if (brigade->head && (bucket = php_stream_bucket_make_writeable(brigade->head TSRMLS_CC))) {
              ALLOC_INIT_ZVAL(zbucket);
              ZEND_REGISTER_RESOURCE(zbucket, bucket, le_bucket);
              object_init(return_value);
              add_property_zval(return_value, "bucket", zbucket);
              /* add_property_zval increments the refcount which is unwanted here */
              zval_ptr_dtor(&zbucket);
              add_property_stringl(return_value, "data", bucket->buf, bucket->buflen, 1);
              add_property_long(return_value, "datalen", bucket->buflen);
       }
}

Here is the call graph for this function:

PHP_FUNCTION ( stream_bucket_prepend  )

Definition at line 488 of file user_filters.c.

Here is the call graph for this function:

PHP_FUNCTION ( stream_bucket_append  )

Definition at line 496 of file user_filters.c.

Here is the call graph for this function:

PHP_FUNCTION ( stream_bucket_new  )

Definition at line 504 of file user_filters.c.

{
       zval *zstream, *zbucket;
       php_stream *stream;
       char *buffer;
       char *pbuffer;
       int buffer_len;
       php_stream_bucket *bucket;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
              RETURN_FALSE;
       }

       php_stream_from_zval(stream, &zstream);

       if (!(pbuffer = pemalloc(buffer_len, php_stream_is_persistent(stream)))) {
              RETURN_FALSE;
       }

       memcpy(pbuffer, buffer, buffer_len);

       bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream) TSRMLS_CC);
       
       if (bucket == NULL) {
              RETURN_FALSE;
       }

       ALLOC_INIT_ZVAL(zbucket);
       ZEND_REGISTER_RESOURCE(zbucket, bucket, le_bucket);
       object_init(return_value);
       add_property_zval(return_value, "bucket", zbucket);
       /* add_property_zval increments the refcount which is unwanted here */
       zval_ptr_dtor(&zbucket);
       add_property_stringl(return_value, "data", bucket->buf, bucket->buflen, 1);
       add_property_long(return_value, "datalen", bucket->buflen);
}

Here is the call graph for this function:

Definition at line 5148 of file basic_functions.c.

{
       syntax_highlighter_ini->highlight_comment = INI_STR("highlight.comment");
       syntax_highlighter_ini->highlight_default = INI_STR("highlight.default");
       syntax_highlighter_ini->highlight_html    = INI_STR("highlight.html");
       syntax_highlighter_ini->highlight_keyword = INI_STR("highlight.keyword");
       syntax_highlighter_ini->highlight_string  = INI_STR("highlight.string");
}

Here is the caller graph for this function:

PHPAPI double php_get_inf ( void  )

Definition at line 3526 of file basic_functions.c.

{
#if HAVE_HUGE_VAL_INF
       return HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
       double val = 0.0;
       ((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH;
       ((php_uint32*)&val)[0] = 0;
       return val;
#elif HAVE_ATOF_ACCEPTS_INF
       return atof("INF");
#else
       return 1.0/0.0;
#endif
}

Here is the caller graph for this function:

PHPAPI double php_get_nan ( void  )

Definition at line 3509 of file basic_functions.c.

{
#if HAVE_HUGE_VAL_NAN
       return HUGE_VAL + -HUGE_VAL;
#elif defined(__i386__) || defined(_X86_) || defined(ALPHA) || defined(_ALPHA) || defined(__alpha)
       double val = 0.0;
       ((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
       ((php_uint32*)&val)[0] = 0;
       return val;
#elif HAVE_ATOF_ACCEPTS_NAN
       return atof("NAN");
#else
       return 0.0/0.0;
#endif
}

Here is the caller graph for this function:

PHP_MINFO_FUNCTION ( basic  )
PHP_MINIT_FUNCTION ( basic  )

Definition at line 3543 of file basic_functions.c.

{
#ifdef ZTS
       ts_allocate_id(&basic_globals_id, sizeof(php_basic_globals), (ts_allocate_ctor) basic_globals_ctor, (ts_allocate_dtor) basic_globals_dtor);
#ifdef PHP_WIN32
       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 );
#endif
#else
       basic_globals_ctor(&basic_globals TSRMLS_CC);
#ifdef PHP_WIN32
       php_win32_core_globals_ctor(&the_php_win32_core_globals TSRMLS_CC);
#endif
#endif

       BG(incomplete_class) = incomplete_class_entry = php_create_incomplete_class(TSRMLS_C);

       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);

       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);

#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);
       REGISTER_MATH_CONSTANT(M_SQRTPI);
       REGISTER_MATH_CONSTANT(M_2_SQRTPI);
       REGISTER_MATH_CONSTANT(M_LNPI);
       REGISTER_MATH_CONSTANT(M_EULER);
       REGISTER_MATH_CONSTANT(M_SQRT2);
       REGISTER_MATH_CONSTANT(M_SQRT1_2);
       REGISTER_MATH_CONSTANT(M_SQRT3);
       REGISTER_DOUBLE_CONSTANT("INF", php_get_inf(), CONST_CS | CONST_PERSISTENT);
       REGISTER_DOUBLE_CONSTANT("NAN", php_get_nan(), CONST_CS | CONST_PERSISTENT);

       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);

#if ENABLE_TEST_CLASS
       test_class_startup();
#endif

       REGISTER_INI_ENTRIES();

       register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
       register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
       register_string_constants(INIT_FUNC_ARGS_PASSTHRU);

       PHP_MINIT(file)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(pack)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(browscap)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(standard_filters)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(user_filters)(INIT_FUNC_ARGS_PASSTHRU);

#if defined(HAVE_LOCALECONV) && defined(ZTS)
       PHP_MINIT(localeconv)(INIT_FUNC_ARGS_PASSTHRU);
#endif

#if defined(HAVE_NL_LANGINFO)
       PHP_MINIT(nl_langinfo)(INIT_FUNC_ARGS_PASSTHRU);
#endif

#if HAVE_CRYPT
       PHP_MINIT(crypt)(INIT_FUNC_ARGS_PASSTHRU);
#endif

       PHP_MINIT(lcg)(INIT_FUNC_ARGS_PASSTHRU);

       PHP_MINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
#ifdef HAVE_SYSLOG_H
       PHP_MINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
#endif
       PHP_MINIT(array)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(assert)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);
#ifdef PHP_CAN_SUPPORT_PROC_OPEN
       PHP_MINIT(proc_open)(INIT_FUNC_ARGS_PASSTHRU);
#endif

       PHP_MINIT(user_streams)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_MINIT(imagetypes)(INIT_FUNC_ARGS_PASSTHRU);

       php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC);
       php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC);
#ifdef HAVE_GLOB
       php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC);
#endif
       php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC);
#ifndef PHP_CURL_URL_WRAPPERS
       php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC);
       php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper TSRMLS_CC);
#endif

#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
       PHP_MINIT(dns)(INIT_FUNC_ARGS_PASSTHRU);
# endif
#endif

       return SUCCESS;
}

Here is the call graph for this function:

PHP_MINIT_FUNCTION ( user_filters  )

Definition at line 88 of file user_filters.c.

{
       zend_class_entry *php_user_filter;
       /* init the filter class ancestor */
       INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", user_filter_class_funcs);
       if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry TSRMLS_CC)) == NULL) {
              return FAILURE;
       }
       zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
       zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);

       /* init the filter resource; it has no dtor, as streams will always clean it up
        * at the correct time */
       le_userfilters = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_FILTER_RES_NAME, 0);

       if (le_userfilters == FAILURE) {
              return FAILURE;
       }

       /* Filters will dispose of their brigades */
       le_bucket_brigade = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_BRIGADE_RES_NAME, module_number);
       /* Brigades will dispose of their buckets */
       le_bucket = zend_register_list_destructors_ex(php_bucket_dtor, NULL, PHP_STREAM_BUCKET_RES_NAME, module_number);
       
       if (le_bucket_brigade == FAILURE) {
              return FAILURE;
       }

       REGISTER_LONG_CONSTANT("PSFS_PASS_ON",                  PSFS_PASS_ON,               CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("PSFS_FEED_ME",                  PSFS_FEED_ME,               CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("PSFS_ERR_FATAL",         PSFS_ERR_FATAL,                    CONST_CS | CONST_PERSISTENT);

       REGISTER_LONG_CONSTANT("PSFS_FLAG_NORMAL",              PSFS_FLAG_NORMAL,           CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_INC",    PSFS_FLAG_FLUSH_INC, CONST_CS | CONST_PERSISTENT);
       REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_CLOSE",  PSFS_FLAG_FLUSH_CLOSE,      CONST_CS | CONST_PERSISTENT);
       
       return SUCCESS;
}

Here is the call graph for this function:

Definition at line 3671 of file basic_functions.c.

{
#ifdef HAVE_SYSLOG_H
       PHP_MSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif
#ifdef ZTS
       ts_free_id(basic_globals_id);
#ifdef PHP_WIN32
       ts_free_id(php_win32_core_globals_id);
#endif
#else
       basic_globals_dtor(&basic_globals TSRMLS_CC);
#ifdef PHP_WIN32
       php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC);
#endif
#endif

       php_unregister_url_stream_wrapper("php" TSRMLS_CC);
#ifndef PHP_CURL_URL_WRAPPERS
       php_unregister_url_stream_wrapper("http" TSRMLS_CC);
       php_unregister_url_stream_wrapper("ftp" TSRMLS_CC);
#endif

       UNREGISTER_INI_ENTRIES();

       PHP_MSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_MSHUTDOWN(array)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_MSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_MSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_MSHUTDOWN(file)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_MSHUTDOWN(standard_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#if defined(HAVE_LOCALECONV) && defined(ZTS)
       PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif
#if HAVE_CRYPT
       PHP_MSHUTDOWN(crypt)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif

       return SUCCESS;
}

Here is the call graph for this function:

PHP_NAMED_FUNCTION ( php_if_crc32  )

Definition at line 27 of file crc32.c.

{
       char *p;
       int len, nr;
       php_uint32 crcinit = 0;
       register php_uint32 crc;

       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &p, &nr) == FAILURE) {
              return;
       }
       crc = crcinit^0xFFFFFFFF;

       for (len =+nr; nr--; ++p) {
              crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF ];
       }
       RETVAL_LONG(crc^0xFFFFFFFF);
}

Here is the call graph for this function:

PHPAPI int php_prefix_varname ( zval *  result,
zval *  prefix,
char *  var_name,
int  var_name_len,
zend_bool add_underscore  TSRMLS_DC 
)

Definition at line 1294 of file array.c.

{
       Z_STRLEN_P(result) = Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0) + var_name_len;
       Z_TYPE_P(result) = IS_STRING;
       Z_STRVAL_P(result) = emalloc(Z_STRLEN_P(result) + 1);
       memcpy(Z_STRVAL_P(result), Z_STRVAL_P(prefix), Z_STRLEN_P(prefix));

       if (add_underscore) {
              Z_STRVAL_P(result)[Z_STRLEN_P(prefix)] = '_';
       }

       memcpy(Z_STRVAL_P(result) + Z_STRLEN_P(prefix) + (add_underscore ? 1 : 0), var_name, var_name_len + 1);

       return SUCCESS;
}

Here is the caller graph for this function:

PHP_RINIT_FUNCTION ( basic  )

Definition at line 3713 of file basic_functions.c.

{
       memset(BG(strtok_table), 0, 256);
       BG(strtok_string) = NULL;
       BG(strtok_zval) = NULL;
       BG(strtok_last) = NULL;
       BG(locale_string) = NULL;
       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;
       BG(page_uid) = -1;
       BG(page_gid) = -1;
       BG(page_inode) = -1;
       BG(page_mtime) = -1;
#ifdef HAVE_PUTENV
       if (zend_hash_init(&BG(putenv_ht), 1, NULL, (void (*)(void *)) php_putenv_destructor, 0) == FAILURE) {
              return FAILURE;
       }
#endif
       BG(user_shutdown_function_names) = NULL;

       PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
#ifdef HAVE_SYSLOG_H
       PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
#endif
       PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
       PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);

       /* Reset magic_quotes_runtime */
       PG(magic_quotes_runtime) = INI_BOOL("magic_quotes_runtime");

       /* Setup default context */
       FG(default_context) = NULL;

       /* Default to global wrappers only */
       FG(stream_wrappers) = NULL;

       /* Default to global filters only */
       FG(stream_filters) = NULL;

       return SUCCESS;
}

Here is the call graph for this function:

Definition at line 3758 of file basic_functions.c.

{
       if (BG(strtok_zval)) {
              zval_ptr_dtor(&BG(strtok_zval));
       }
       BG(strtok_string) = NULL;
       BG(strtok_zval) = NULL;
#ifdef HAVE_PUTENV
       zend_hash_destroy(&BG(putenv_ht));
#endif

       if (BG(umask) != -1) {
              umask(BG(umask));
       }

       /* Check if locale was changed and change it back
        * to the value in startup environment */
       if (BG(locale_string) != NULL) {
              setlocale(LC_ALL, "C");
              setlocale(LC_CTYPE, "");
              zend_update_current_locale();
       }
       STR_FREE(BG(locale_string));
       BG(locale_string) = NULL;

       /* FG(stream_wrappers) and FG(stream_filters) are destroyed
        * during php_request_shutdown() */

       PHP_RSHUTDOWN(filestat)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#ifdef HAVE_SYSLOG_H
#ifdef PHP_WIN32
       PHP_RSHUTDOWN(syslog)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif
#endif
       PHP_RSHUTDOWN(assert)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_RSHUTDOWN(url_scanner_ex)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_RSHUTDOWN(streams)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#ifdef PHP_WIN32
       PHP_RSHUTDOWN(win32_core_globals)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif

       if (BG(user_tick_functions)) {
              zend_llist_destroy(BG(user_tick_functions));
              efree(BG(user_tick_functions));
              BG(user_tick_functions) = NULL;
       }

       PHP_RSHUTDOWN(user_filters)(SHUTDOWN_FUNC_ARGS_PASSTHRU);
       PHP_RSHUTDOWN(browscap)(SHUTDOWN_FUNC_ARGS_PASSTHRU);

       BG(page_uid) = -1;
       BG(page_gid) = -1;
       return SUCCESS;
}

Here is the call graph for this function:

PHP_RSHUTDOWN_FUNCTION ( user_filters  )

Definition at line 127 of file user_filters.c.

{
       if (BG(user_filter_map)) {
              zend_hash_destroy(BG(user_filter_map));
              efree(BG(user_filter_map));
              BG(user_filter_map) = NULL;
       }

       return SUCCESS;
}

Here is the call graph for this function:

PHP_RSHUTDOWN_FUNCTION ( browscap  )

Definition at line 353 of file browscap.c.

{
       browser_data *bdata = &BROWSCAP_G(activation_bdata);
       if (bdata->filename[0] != '\0') {
              browscap_bdata_dtor(bdata, 0 TSRMLS_CC);
       }
       
       return SUCCESS;
}

Here is the call graph for this function:


Variable Documentation

zend_module_entry basic_functions_module

Definition at line 3408 of file basic_functions.c.

Definition at line 114 of file basic_functions.c.