Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions
zend_ini.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _zend_ini_entry
struct  _zend_ini_parser_param

Defines

#define ZEND_INI_USER   (1<<0)
#define ZEND_INI_PERDIR   (1<<1)
#define ZEND_INI_SYSTEM   (1<<2)
#define ZEND_INI_ALL   (ZEND_INI_USER|ZEND_INI_PERDIR|ZEND_INI_SYSTEM)
#define XtOffset(p_type, field)   ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
#define XtOffsetOf(s_type, field)   XtOffset(s_type*, field)
#define ZEND_INI_MH(name)   int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)
#define ZEND_INI_DISP(name)   void name(zend_ini_entry *ini_entry, int type)
#define ZEND_INI_BEGIN()   static const zend_ini_entry ini_entries[] = {
#define ZEND_INI_END()   { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };
#define ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, displayer)   { 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, 0, displayer },
#define ZEND_INI_ENTRY3(name, default_value, modifiable, on_modify, arg1, arg2, arg3)   ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)
#define ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, displayer)   ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer)
#define ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, arg1, arg2)   ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL)
#define ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, displayer)   ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer)
#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1)   ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL)
#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer)   ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer)
#define ZEND_INI_ENTRY(name, default_value, modifiable, on_modify)   ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL)
#define STD_ZEND_INI_ENTRY(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr)   ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)
#define STD_ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr, displayer)   ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)
#define STD_ZEND_INI_BOOLEAN(name, default_value, modifiable, on_modify, property_name, struct_type, struct_ptr)   ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)
#define INI_INT(name)   zend_ini_long((name), sizeof(name), 0)
#define INI_FLT(name)   zend_ini_double((name), sizeof(name), 0)
#define INI_STR(name)   zend_ini_string_ex((name), sizeof(name), 0, NULL)
#define INI_BOOL(name)   ((zend_bool) INI_INT(name))
#define INI_ORIG_INT(name)   zend_ini_long((name), sizeof(name), 1)
#define INI_ORIG_FLT(name)   zend_ini_double((name), sizeof(name), 1)
#define INI_ORIG_STR(name)   zend_ini_string((name), sizeof(name), 1)
#define INI_ORIG_BOOL(name)   ((zend_bool) INI_ORIG_INT(name))
#define REGISTER_INI_ENTRIES()   zend_register_ini_entries(ini_entries, module_number TSRMLS_CC)
#define UNREGISTER_INI_ENTRIES()   zend_unregister_ini_entries(module_number TSRMLS_CC)
#define DISPLAY_INI_ENTRIES()   display_ini_entries(zend_module)
#define REGISTER_INI_DISPLAYER(name, displayer)   zend_ini_register_displayer((name), sizeof(name), displayer)
#define REGISTER_INI_BOOLEAN(name)   REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)
#define ZEND_INI_DISPLAY_ORIG   1
#define ZEND_INI_DISPLAY_ACTIVE   2
#define ZEND_INI_STAGE_STARTUP   (1<<0)
#define ZEND_INI_STAGE_SHUTDOWN   (1<<1)
#define ZEND_INI_STAGE_ACTIVATE   (1<<2)
#define ZEND_INI_STAGE_DEACTIVATE   (1<<3)
#define ZEND_INI_STAGE_RUNTIME   (1<<4)
#define ZEND_INI_STAGE_HTACCESS   (1<<5)
#define ZEND_INI_PARSER_ENTRY   1 /* Normal entry: foo = bar */
#define ZEND_INI_PARSER_SECTION   2 /* Section: [foobar] */
#define ZEND_INI_PARSER_POP_ENTRY   3 /* Offset entry: foo[] = bar */

Typedefs

typedef struct _zend_ini_entry
typedef void(* zend_ini_parser_cb_t )(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC)
typedef struct
_zend_ini_parser_param 
zend_ini_parser_param

Functions

ZEND_API int zend_ini_startup (TSRMLS_D)
ZEND_API int zend_ini_shutdown (TSRMLS_D)
ZEND_API int zend_ini_global_shutdown (TSRMLS_D)
ZEND_API int zend_ini_deactivate (TSRMLS_D)
ZEND_API int zend_copy_ini_directives (TSRMLS_D)
ZEND_API void zend_ini_sort_entries (TSRMLS_D)
ZEND_API int zend_register_ini_entries (const zend_ini_entry *ini_entry, int module_number TSRMLS_DC)
ZEND_API void zend_unregister_ini_entries (int module_number TSRMLS_DC)
ZEND_API void zend_ini_refresh_caches (int stage TSRMLS_DC)
ZEND_API int zend_alter_ini_entry (char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage)
ZEND_API int zend_alter_ini_entry_ex (char *name, uint name_length, char *new_value, uint new_value_length, int modify_type, int stage, int force_change TSRMLS_DC)
ZEND_API int zend_restore_ini_entry (char *name, uint name_length, int stage)
ZEND_API void display_ini_entries (zend_module_entry *module)
ZEND_API long zend_ini_long (char *name, uint name_length, int orig)
ZEND_API double zend_ini_double (char *name, uint name_length, int orig)
ZEND_API char * zend_ini_string (char *name, uint name_length, int orig)
ZEND_API char * zend_ini_string_ex (char *name, uint name_length, int orig, zend_bool *exists)
ZEND_API int zend_ini_register_displayer (char *name, uint name_length, void(*displayer)(zend_ini_entry *ini_entry, int type))
ZEND_API ZEND_INI_DISP (zend_ini_boolean_displayer_cb)
ZEND_API ZEND_INI_DISP (zend_ini_color_displayer_cb)
ZEND_API ZEND_INI_DISP (display_link_numbers)
ZEND_API ZEND_INI_MH (OnUpdateBool)
ZEND_API ZEND_INI_MH (OnUpdateLong)
ZEND_API ZEND_INI_MH (OnUpdateLongGEZero)
ZEND_API ZEND_INI_MH (OnUpdateReal)
ZEND_API ZEND_INI_MH (OnUpdateString)
ZEND_API ZEND_INI_MH (OnUpdateStringUnempty)
ZEND_API int zend_parse_ini_file (zend_file_handle *fh, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg TSRMLS_DC)
ZEND_API int zend_parse_ini_string (char *str, zend_bool unbuffered_errors, int scanner_mode, zend_ini_parser_cb_t ini_parser_cb, void *arg TSRMLS_DC)

Class Documentation

struct _zend_ini_parser_param

Definition at line 208 of file zend_ini.h.

Class Members
void * arg
zend_ini_parser_cb_t ini_parser_cb

Define Documentation

#define DISPLAY_INI_ENTRIES ( )    display_ini_entries(zend_module)

Definition at line 171 of file zend_ini.h.

#define INI_BOOL (   name)    ((zend_bool) INI_INT(name))

Definition at line 162 of file zend_ini.h.

#define INI_FLT (   name)    zend_ini_double((name), sizeof(name), 0)

Definition at line 160 of file zend_ini.h.

#define INI_INT (   name)    zend_ini_long((name), sizeof(name), 0)

Definition at line 159 of file zend_ini.h.

#define INI_ORIG_BOOL (   name)    ((zend_bool) INI_ORIG_INT(name))

Definition at line 167 of file zend_ini.h.

#define INI_ORIG_FLT (   name)    zend_ini_double((name), sizeof(name), 1)

Definition at line 165 of file zend_ini.h.

#define INI_ORIG_INT (   name)    zend_ini_long((name), sizeof(name), 1)

Definition at line 164 of file zend_ini.h.

#define INI_ORIG_STR (   name)    zend_ini_string((name), sizeof(name), 1)

Definition at line 166 of file zend_ini.h.

#define INI_STR (   name)    zend_ini_string_ex((name), sizeof(name), 0, NULL)

Definition at line 161 of file zend_ini.h.

#define REGISTER_INI_BOOLEAN (   name)    REGISTER_INI_DISPLAYER(name, zend_ini_boolean_displayer_cb)

Definition at line 174 of file zend_ini.h.

#define REGISTER_INI_DISPLAYER (   name,
  displayer 
)    zend_ini_register_displayer((name), sizeof(name), displayer)

Definition at line 173 of file zend_ini.h.

#define REGISTER_INI_ENTRIES ( )    zend_register_ini_entries(ini_entries, module_number TSRMLS_CC)

Definition at line 169 of file zend_ini.h.

#define STD_ZEND_INI_BOOLEAN (   name,
  default_value,
  modifiable,
  on_modify,
  property_name,
  struct_type,
  struct_ptr 
)    ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, NULL, zend_ini_boolean_displayer_cb)

Definition at line 155 of file zend_ini.h.

#define STD_ZEND_INI_ENTRY (   name,
  default_value,
  modifiable,
  on_modify,
  property_name,
  struct_type,
  struct_ptr 
)    ZEND_INI_ENTRY2(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr)

Definition at line 151 of file zend_ini.h.

#define STD_ZEND_INI_ENTRY_EX (   name,
  default_value,
  modifiable,
  on_modify,
  property_name,
  struct_type,
  struct_ptr,
  displayer 
)    ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, (void *) XtOffsetOf(struct_type, property_name), (void *) &struct_ptr, displayer)

Definition at line 153 of file zend_ini.h.

Definition at line 170 of file zend_ini.h.

#define XtOffset (   p_type,
  field 
)    ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))

Definition at line 47 of file zend_ini.h.

#define XtOffsetOf (   s_type,
  field 
)    XtOffset(s_type*, field)

Definition at line 55 of file zend_ini.h.

Definition at line 28 of file zend_ini.h.

#define ZEND_INI_BEGIN ( )    static const zend_ini_entry ini_entries[] = {

Definition at line 116 of file zend_ini.h.

#define ZEND_INI_DISP (   name)    void name(zend_ini_entry *ini_entry, int type)

Definition at line 63 of file zend_ini.h.

#define ZEND_INI_DISPLAY_ACTIVE   2

Definition at line 187 of file zend_ini.h.

#define ZEND_INI_DISPLAY_ORIG   1

Definition at line 186 of file zend_ini.h.

#define ZEND_INI_END ( )    { 0, 0, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0, NULL } };

Definition at line 117 of file zend_ini.h.

#define ZEND_INI_ENTRY (   name,
  default_value,
  modifiable,
  on_modify 
)    ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, NULL)

Definition at line 140 of file zend_ini.h.

#define ZEND_INI_ENTRY1 (   name,
  default_value,
  modifiable,
  on_modify,
  arg1 
)    ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL)

Definition at line 134 of file zend_ini.h.

#define ZEND_INI_ENTRY1_EX (   name,
  default_value,
  modifiable,
  on_modify,
  arg1,
  displayer 
)    ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, NULL, NULL, displayer)

Definition at line 131 of file zend_ini.h.

#define ZEND_INI_ENTRY2 (   name,
  default_value,
  modifiable,
  on_modify,
  arg1,
  arg2 
)    ZEND_INI_ENTRY2_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL)

Definition at line 128 of file zend_ini.h.

#define ZEND_INI_ENTRY2_EX (   name,
  default_value,
  modifiable,
  on_modify,
  arg1,
  arg2,
  displayer 
)    ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, NULL, displayer)

Definition at line 125 of file zend_ini.h.

#define ZEND_INI_ENTRY3 (   name,
  default_value,
  modifiable,
  on_modify,
  arg1,
  arg2,
  arg3 
)    ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, arg1, arg2, arg3, NULL)

Definition at line 122 of file zend_ini.h.

#define ZEND_INI_ENTRY3_EX (   name,
  default_value,
  modifiable,
  on_modify,
  arg1,
  arg2,
  arg3,
  displayer 
)    { 0, modifiable, name, sizeof(name), on_modify, arg1, arg2, arg3, default_value, sizeof(default_value)-1, NULL, 0, 0, 0, displayer },

Definition at line 119 of file zend_ini.h.

#define ZEND_INI_ENTRY_EX (   name,
  default_value,
  modifiable,
  on_modify,
  displayer 
)    ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer)

Definition at line 137 of file zend_ini.h.

#define ZEND_INI_MH (   name)    int name(zend_ini_entry *entry, char *new_value, uint new_value_length, void *mh_arg1, void *mh_arg2, void *mh_arg3, int stage TSRMLS_DC)

Definition at line 62 of file zend_ini.h.

#define ZEND_INI_PARSER_ENTRY   1 /* Normal entry: foo = bar */

Definition at line 204 of file zend_ini.h.

#define ZEND_INI_PARSER_POP_ENTRY   3 /* Offset entry: foo[] = bar */

Definition at line 206 of file zend_ini.h.

#define ZEND_INI_PARSER_SECTION   2 /* Section: [foobar] */

Definition at line 205 of file zend_ini.h.

#define ZEND_INI_PERDIR   (1<<1)

Definition at line 25 of file zend_ini.h.

#define ZEND_INI_STAGE_ACTIVATE   (1<<2)

Definition at line 191 of file zend_ini.h.

#define ZEND_INI_STAGE_DEACTIVATE   (1<<3)

Definition at line 192 of file zend_ini.h.

#define ZEND_INI_STAGE_HTACCESS   (1<<5)

Definition at line 194 of file zend_ini.h.

#define ZEND_INI_STAGE_RUNTIME   (1<<4)

Definition at line 193 of file zend_ini.h.

#define ZEND_INI_STAGE_SHUTDOWN   (1<<1)

Definition at line 190 of file zend_ini.h.

#define ZEND_INI_STAGE_STARTUP   (1<<0)

Definition at line 189 of file zend_ini.h.

#define ZEND_INI_SYSTEM   (1<<2)

Definition at line 26 of file zend_ini.h.

#define ZEND_INI_USER   (1<<0)

Definition at line 24 of file zend_ini.h.


Typedef Documentation

typedef struct _zend_ini_entry

Definition at line 60 of file zend_ini.h.

typedef void(* zend_ini_parser_cb_t)(zval *arg1, zval *arg2, zval *arg3, int callback_type, void *arg TSRMLS_DC)

Definition at line 197 of file zend_ini.h.


Function Documentation

ZEND_API void display_ini_entries ( zend_module_entry *  module)

Definition at line 165 of file php_ini.c.

{
       int module_number, module_number_available;
       TSRMLS_FETCH();

       if (module) {
              module_number = module->module_number;
       } else {
              module_number = 0;
       }
       module_number_available = module_number;
       zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_available, &module_number_available TSRMLS_CC);
       if (module_number_available == -1) {
              php_info_print_table_start();
              php_info_print_table_header(3, "Directive", "Local Value", "Master Value");
              zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC);
              php_info_print_table_end();
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_alter_ini_entry ( char *  name,
uint  name_length,
char *  new_value,
uint  new_value_length,
int  modify_type,
int  stage 
)

Definition at line 245 of file zend_ini.c.

{
       TSRMLS_FETCH();

       return zend_alter_ini_entry_ex(name, name_length, new_value, new_value_length, modify_type, stage, 0 TSRMLS_CC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_alter_ini_entry_ex ( char *  name,
uint  name_length,
char *  new_value,
uint  new_value_length,
int  modify_type,
int  stage,
int force_change  TSRMLS_DC 
)

Definition at line 253 of file zend_ini.c.

{
       zend_ini_entry *ini_entry;
       char *duplicate;
       zend_bool modifiable;
       zend_bool modified;

       if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE) {
              return FAILURE;
       }

       modifiable = ini_entry->modifiable;
       modified = ini_entry->modified;

       if (stage == ZEND_INI_STAGE_ACTIVATE && modify_type == ZEND_INI_SYSTEM) {
              ini_entry->modifiable = ZEND_INI_SYSTEM;
       }

       if (!force_change) {
              if (!(ini_entry->modifiable & modify_type)) {
                     return FAILURE;
              }
       }

       if (!EG(modified_ini_directives)) {
              ALLOC_HASHTABLE(EG(modified_ini_directives));
              zend_hash_init(EG(modified_ini_directives), 8, NULL, NULL, 0);
       }
       if (!modified) {
              ini_entry->orig_value = ini_entry->value;
              ini_entry->orig_value_length = ini_entry->value_length;
              ini_entry->orig_modifiable = modifiable;
              ini_entry->modified = 1;
              zend_hash_add(EG(modified_ini_directives), name, name_length, &ini_entry, sizeof(zend_ini_entry*), NULL);
       }

       duplicate = estrndup(new_value, new_value_length);

       if (!ini_entry->on_modify
              || ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC) == SUCCESS) {
              if (modified && ini_entry->orig_value != ini_entry->value) { /* we already changed the value, free the changed value */
                     efree(ini_entry->value);
              }
              ini_entry->value = duplicate;
              ini_entry->value_length = new_value_length;
       } else {
              efree(duplicate);
              return FAILURE;
       }

       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

Definition at line 118 of file zend_ini.c.

{
       if (EG(modified_ini_directives)) {
              zend_hash_apply(EG(modified_ini_directives), (apply_func_t) zend_restore_ini_entry_wrapper TSRMLS_CC);
              zend_hash_destroy(EG(modified_ini_directives));
              FREE_HASHTABLE(EG(modified_ini_directives));
              EG(modified_ini_directives) = NULL;
       }
       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API ZEND_INI_DISP ( zend_ini_boolean_displayer_cb  )

Definition at line 459 of file zend_ini.c.

{
       int value, tmp_value_len;
       char *tmp_value;

       if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
              tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL );
              tmp_value_len = ini_entry->orig_value_length;
       } else if (ini_entry->value) {
              tmp_value = ini_entry->value;
              tmp_value_len = ini_entry->value_length;
       } else {
              tmp_value = NULL;
              tmp_value_len = 0;
       }

       if (tmp_value) {
              if (tmp_value_len == 4 && strcasecmp(tmp_value, "true") == 0) {
                     value = 1;
              } else if (tmp_value_len == 3 && strcasecmp(tmp_value, "yes") == 0) {
                     value = 1;
              } else if (tmp_value_len == 2 && strcasecmp(tmp_value, "on") == 0) {
                     value = 1;
              } else {
                     value = atoi(tmp_value);
              }
       } else {
              value = 0;
       }

       if (value) {
              ZEND_PUTS("On");
       } else {
              ZEND_PUTS("Off");
       }
}
ZEND_API ZEND_INI_DISP ( zend_ini_color_displayer_cb  )

Definition at line 497 of file zend_ini.c.

{
       char *value;

       if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
              value = ini_entry->orig_value;
       } else if (ini_entry->value) {
              value = ini_entry->value;
       } else {
              value = NULL;
       }
       if (value) {
              if (zend_uv.html_errors) {
                     zend_printf("<font style=\"color: %s\">%s</font>", value, value);
              } else {
                     ZEND_PUTS(value);
              }
       } else {
              if (zend_uv.html_errors) {
                     ZEND_PUTS(NO_VALUE_HTML);
              } else {
                     ZEND_PUTS(NO_VALUE_PLAINTEXT);
              }
       }
}
ZEND_API ZEND_INI_DISP ( display_link_numbers  )

Definition at line 524 of file zend_ini.c.

{
       char *value;

       if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
              value = ini_entry->orig_value;
       } else if (ini_entry->value) {
              value = ini_entry->value;
       } else {
              value = NULL;
       }

       if (value) {
              if (atoi(value) == -1) {
                     ZEND_PUTS("Unlimited");
              } else {
                     zend_printf("%s", value);
              }
       }
}
ZEND_API double zend_ini_double ( char *  name,
uint  name_length,
int  orig 
)

Definition at line 363 of file zend_ini.c.

{
       zend_ini_entry *ini_entry;
       TSRMLS_FETCH();

       if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
              if (orig && ini_entry->modified) {
                     return (double) (ini_entry->orig_value ? zend_strtod(ini_entry->orig_value, NULL) : 0.0);
              } else {
                     return (double) (ini_entry->value      ? zend_strtod(ini_entry->value, NULL)      : 0.0);
              }
       }

       return 0.0;
}

Here is the call graph for this function:

Definition at line 110 of file zend_ini.c.

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API long zend_ini_long ( char *  name,
uint  name_length,
int  orig 
)

Definition at line 346 of file zend_ini.c.

{
       zend_ini_entry *ini_entry;
       TSRMLS_FETCH();

       if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
              if (orig && ini_entry->modified) {
                     return (ini_entry->orig_value ? strtol(ini_entry->orig_value, NULL, 0) : 0);
              } else {
                     return (ini_entry->value      ? strtol(ini_entry->value, NULL, 0)      : 0);
              }
       }

       return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API ZEND_INI_MH ( OnUpdateBool  )

Definition at line 547 of file zend_ini.c.

{
       zend_bool *p;
#ifndef ZTS
       char *base = (char *) mh_arg2;
#else
       char *base;

       base = (char *) ts_resource(*((int *) mh_arg2));
#endif

       p = (zend_bool *) (base+(size_t) mh_arg1);

       if (new_value_length == 2 && strcasecmp("on", new_value) == 0) {
              *p = (zend_bool) 1;
       }
       else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) {
              *p = (zend_bool) 1;
       }
       else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) {
              *p = (zend_bool) 1;
       }
       else {
              *p = (zend_bool) atoi(new_value);
       }
       return SUCCESS;
}

Definition at line 576 of file zend_ini.c.

{
       long *p;
#ifndef ZTS
       char *base = (char *) mh_arg2;
#else
       char *base;

       base = (char *) ts_resource(*((int *) mh_arg2));
#endif

       p = (long *) (base+(size_t) mh_arg1);

       *p = zend_atol(new_value, new_value_length);
       return SUCCESS;
}

Here is the call graph for this function:

ZEND_API ZEND_INI_MH ( OnUpdateLongGEZero  )

Definition at line 594 of file zend_ini.c.

{
       long *p, tmp;
#ifndef ZTS
       char *base = (char *) mh_arg2;
#else
       char *base;

       base = (char *) ts_resource(*((int *) mh_arg2));
#endif

       tmp = zend_atol(new_value, new_value_length);
       if (tmp < 0) {
              return FAILURE;
       }

       p = (long *) (base+(size_t) mh_arg1);
       *p = tmp;

       return SUCCESS;
}

Here is the call graph for this function:

ZEND_API ZEND_INI_MH ( OnUpdateReal  )

Definition at line 617 of file zend_ini.c.

{
       double *p;
#ifndef ZTS
       char *base = (char *) mh_arg2;
#else
       char *base;

       base = (char *) ts_resource(*((int *) mh_arg2));
#endif

       p = (double *) (base+(size_t) mh_arg1);

       *p = zend_strtod(new_value, NULL);
       return SUCCESS;
}

Here is the call graph for this function:

ZEND_API ZEND_INI_MH ( OnUpdateString  )

Definition at line 635 of file zend_ini.c.

{
       char **p;
#ifndef ZTS
       char *base = (char *) mh_arg2;
#else
       char *base;

       base = (char *) ts_resource(*((int *) mh_arg2));
#endif

       p = (char **) (base+(size_t) mh_arg1);

       *p = new_value;
       return SUCCESS;
}
ZEND_API ZEND_INI_MH ( OnUpdateStringUnempty  )

Definition at line 653 of file zend_ini.c.

{
       char **p;
#ifndef ZTS
       char *base = (char *) mh_arg2;
#else
       char *base;

       base = (char *) ts_resource(*((int *) mh_arg2));
#endif

       if (new_value && !new_value[0]) {
              return FAILURE;
       }

       p = (char **) (base+(size_t) mh_arg1);

       *p = new_value;
       return SUCCESS;
}
ZEND_API void zend_ini_refresh_caches ( int stage  TSRMLS_DC)
ZEND_API int zend_ini_register_displayer ( char *  name,
uint  name_length,
void(*)(zend_ini_entry *ini_entry, int type displayer 
)

Definition at line 329 of file zend_ini.c.

{
       zend_ini_entry *ini_entry;

       if (zend_hash_find(registered_zend_ini_directives, name, name_length, (void **) &ini_entry) == FAILURE) {
              return FAILURE;
       }

       ini_entry->displayer = displayer;
       return SUCCESS;
}

Here is the call graph for this function:

Definition at line 102 of file zend_ini.c.

{
       zend_hash_destroy(EG(ini_directives));
       free(EG(ini_directives));
       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 166 of file zend_ini.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 89 of file zend_ini.c.

{
       registered_zend_ini_directives = (HashTable *) malloc(sizeof(HashTable));

       EG(ini_directives) = registered_zend_ini_directives;
       EG(modified_ini_directives) = NULL;
       if (zend_hash_init_ex(registered_zend_ini_directives, 100, NULL, NULL, 1, 0) == FAILURE) {
              return FAILURE;
       }
       return SUCCESS;
}

Here is the caller graph for this function:

ZEND_API char* zend_ini_string ( char *  name,
uint  name_length,
int  orig 
)

Definition at line 404 of file zend_ini.c.

{
       zend_bool exists = 1;
       char *return_value;

       return_value = zend_ini_string_ex(name, name_length, orig, &exists);
       if (!exists) {
              return NULL;
       } else if (!return_value) {
              return_value = "";
       }
       return return_value;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API char* zend_ini_string_ex ( char *  name,
uint  name_length,
int  orig,
zend_bool exists 
)

Definition at line 380 of file zend_ini.c.

{
       zend_ini_entry *ini_entry;
       TSRMLS_FETCH();

       if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == SUCCESS) {
              if (exists) {
                     *exists = 1;
              }

              if (orig && ini_entry->modified) {
                     return ini_entry->orig_value;
              } else {
                     return ini_entry->value;
              }
       } else {
              if (exists) {
                     *exists = 0;
              }
              return NULL;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_parse_ini_file ( zend_file_handle fh,
zend_bool  unbuffered_errors,
int  scanner_mode,
zend_ini_parser_cb_t  ini_parser_cb,
void *arg  TSRMLS_DC 
)

Definition at line 269 of file zend_ini_parser.c.

{
       int retval;
       zend_ini_parser_param ini_parser_param;

       ini_parser_param.ini_parser_cb = ini_parser_cb;
       ini_parser_param.arg = arg;
       CG(ini_parser_param) = &ini_parser_param;

       if (zend_ini_open_file_for_scanning(fh, scanner_mode TSRMLS_CC) == FAILURE) {
              return FAILURE;
       }

       CG(ini_parser_unbuffered_errors) = unbuffered_errors;
       retval = ini_parse(TSRMLS_C);
       zend_file_handle_dtor(fh TSRMLS_CC);

       shutdown_ini_scanner(TSRMLS_C);
       
       if (retval == 0) {
              return SUCCESS;
       } else {
              return FAILURE;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_parse_ini_string ( char *  str,
zend_bool  unbuffered_errors,
int  scanner_mode,
zend_ini_parser_cb_t  ini_parser_cb,
void *arg  TSRMLS_DC 
)

Definition at line 298 of file zend_ini_parser.c.

{
       int retval;
       zend_ini_parser_param ini_parser_param;

       ini_parser_param.ini_parser_cb = ini_parser_cb;
       ini_parser_param.arg = arg;
       CG(ini_parser_param) = &ini_parser_param;

       if (zend_ini_prepare_string_for_scanning(str, scanner_mode TSRMLS_CC) == FAILURE) {
              return FAILURE;
       }

       CG(ini_parser_unbuffered_errors) = unbuffered_errors;
       retval = ini_parse(TSRMLS_C);

       shutdown_ini_scanner(TSRMLS_C);

       if (retval == 0) {
              return SUCCESS;
       } else {
              return FAILURE;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API int zend_register_ini_entries ( const zend_ini_entry *  ini_entry,
int module_number  TSRMLS_DC 
)

Definition at line 175 of file zend_ini.c.

{
       const zend_ini_entry *p = ini_entry;
       zend_ini_entry *hashed_ini_entry;
       zval default_value;
       HashTable *directives = registered_zend_ini_directives;
       zend_bool config_directive_success = 0;

#ifdef ZTS
       /* if we are called during the request, eg: from dl(),
        * then we should not touch the global directives table,
        * and should update the per-(request|thread) version instead.
        * This solves two problems: one is that ini entries for dl()'d
        * extensions will now work, and the second is that updating the
        * global hash here from dl() is not mutex protected and can
        * lead to death.
        */
       if (directives != EG(ini_directives)) {
              directives = EG(ini_directives);
       }
#endif

       while (p->name) {
              config_directive_success = 0;
              if (zend_hash_add(directives, p->name, p->name_length, (void*)p, sizeof(zend_ini_entry), (void **) &hashed_ini_entry) == FAILURE) {
                     zend_unregister_ini_entries(module_number TSRMLS_CC);
                     return FAILURE;
              }
              hashed_ini_entry->module_number = module_number;
              if ((zend_get_configuration_directive(p->name, p->name_length, &default_value)) == SUCCESS) {
                     if (!hashed_ini_entry->on_modify
                            || hashed_ini_entry->on_modify(hashed_ini_entry, Z_STRVAL(default_value), Z_STRLEN(default_value), hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC) == SUCCESS) {
                            hashed_ini_entry->value = Z_STRVAL(default_value);
                            hashed_ini_entry->value_length = Z_STRLEN(default_value);
                            config_directive_success = 1;
                     }
              }

              if (!config_directive_success && hashed_ini_entry->on_modify) {
                     hashed_ini_entry->on_modify(hashed_ini_entry, hashed_ini_entry->value, hashed_ini_entry->value_length, hashed_ini_entry->mh_arg1, hashed_ini_entry->mh_arg2, hashed_ini_entry->mh_arg3, ZEND_INI_STAGE_STARTUP TSRMLS_CC);
              }
              p++;
       }
       return SUCCESS;
}

Here is the call graph for this function:

ZEND_API int zend_restore_ini_entry ( char *  name,
uint  name_length,
int  stage 
)

Definition at line 307 of file zend_ini.c.

{
       zend_ini_entry *ini_entry;
       TSRMLS_FETCH();

       if (zend_hash_find(EG(ini_directives), name, name_length, (void **) &ini_entry) == FAILURE ||
              (stage == ZEND_INI_STAGE_RUNTIME && (ini_entry->modifiable & ZEND_INI_USER) == 0)) {
              return FAILURE;
       }

       if (EG(modified_ini_directives)) {
              if (zend_restore_ini_entry_cb(ini_entry, stage TSRMLS_CC) == 0) {
                     zend_hash_del(EG(modified_ini_directives), name, name_length);
              } else {
                     return FAILURE;
              }
       }

       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ZEND_API void zend_unregister_ini_entries ( int module_number  TSRMLS_DC)

Definition at line 222 of file zend_ini.c.

Here is the call graph for this function:

Here is the caller graph for this function: