Back to index

php5  5.3.10
Defines | Functions
php_ini.h File Reference
#include "zend_ini.h"

Go to the source code of this file.

Defines

#define PHP_INI_USER   ZEND_INI_USER
#define PHP_INI_PERDIR   ZEND_INI_PERDIR
#define PHP_INI_SYSTEM   ZEND_INI_SYSTEM
#define PHP_INI_ALL   ZEND_INI_ALL
#define php_ini_entry   zend_ini_entry
#define PHP_INI_MH   ZEND_INI_MH
#define PHP_INI_DISP   ZEND_INI_DISP
#define PHP_INI_BEGIN   ZEND_INI_BEGIN
#define PHP_INI_END   ZEND_INI_END
#define PHP_INI_ENTRY3_EX   ZEND_INI_ENTRY3_EX
#define PHP_INI_ENTRY3   ZEND_INI_ENTRY3
#define PHP_INI_ENTRY2_EX   ZEND_INI_ENTRY2_EX
#define PHP_INI_ENTRY2   ZEND_INI_ENTRY2
#define PHP_INI_ENTRY1_EX   ZEND_INI_ENTRY1_EX
#define PHP_INI_ENTRY1   ZEND_INI_ENTRY1
#define PHP_INI_ENTRY_EX   ZEND_INI_ENTRY_EX
#define PHP_INI_ENTRY   ZEND_INI_ENTRY
#define STD_PHP_INI_ENTRY   STD_ZEND_INI_ENTRY
#define STD_PHP_INI_ENTRY_EX   STD_ZEND_INI_ENTRY_EX
#define STD_PHP_INI_BOOLEAN   STD_ZEND_INI_BOOLEAN
#define PHP_INI_DISPLAY_ORIG   ZEND_INI_DISPLAY_ORIG
#define PHP_INI_DISPLAY_ACTIVE   ZEND_INI_DISPLAY_ACTIVE
#define PHP_INI_STAGE_STARTUP   ZEND_INI_STAGE_STARTUP
#define PHP_INI_STAGE_SHUTDOWN   ZEND_INI_STAGE_SHUTDOWN
#define PHP_INI_STAGE_ACTIVATE   ZEND_INI_STAGE_ACTIVATE
#define PHP_INI_STAGE_DEACTIVATE   ZEND_INI_STAGE_DEACTIVATE
#define PHP_INI_STAGE_RUNTIME   ZEND_INI_STAGE_RUNTIME
#define PHP_INI_STAGE_HTACCESS   ZEND_INI_STAGE_HTACCESS
#define php_ini_boolean_displayer_cb   zend_ini_boolean_displayer_cb
#define php_ini_color_displayer_cb   zend_ini_color_displayer_cb
#define php_alter_ini_entry   zend_alter_ini_entry
#define php_ini_long   zend_ini_long
#define php_ini_double   zend_ini_double
#define php_ini_string   zend_ini_string

Functions

PHPAPI void config_zval_dtor (zval *zvalue)
int php_init_config (TSRMLS_D)
int php_shutdown_config (void)
void php_ini_register_extensions (TSRMLS_D)
PHPAPI zval * cfg_get_entry (const char *name, uint name_length)
PHPAPI int cfg_get_long (const char *varname, long *result)
PHPAPI int cfg_get_double (const char *varname, double *result)
PHPAPI int cfg_get_string (const char *varname, char **result)
PHPAPI int php_parse_user_ini_file (const char *dirname, char *ini_filename, HashTable *target_hash TSRMLS_DC)
PHPAPI void php_ini_activate_config (HashTable *source_hash, int modify_type, int stage TSRMLS_DC)
PHPAPI int php_ini_has_per_dir_config (void)
PHPAPI int php_ini_has_per_host_config (void)
PHPAPI void php_ini_activate_per_dir_config (char *path, uint path_len TSRMLS_DC)
PHPAPI void php_ini_activate_per_host_config (const char *host, uint host_len TSRMLS_DC)
PHPAPI HashTablephp_ini_get_configuration_hash (void)

Define Documentation

Definition at line 84 of file php_ini.h.

#define PHP_INI_ALL   ZEND_INI_ALL

Definition at line 48 of file php_ini.h.

Definition at line 55 of file php_ini.h.

#define php_ini_boolean_displayer_cb   zend_ini_boolean_displayer_cb

Definition at line 81 of file php_ini.h.

#define php_ini_color_displayer_cb   zend_ini_color_displayer_cb

Definition at line 82 of file php_ini.h.

Definition at line 53 of file php_ini.h.

Definition at line 72 of file php_ini.h.

Definition at line 71 of file php_ini.h.

Definition at line 87 of file php_ini.h.

#define PHP_INI_END   ZEND_INI_END

Definition at line 56 of file php_ini.h.

#define php_ini_entry   zend_ini_entry

Definition at line 50 of file php_ini.h.

Definition at line 65 of file php_ini.h.

Definition at line 63 of file php_ini.h.

Definition at line 62 of file php_ini.h.

Definition at line 61 of file php_ini.h.

Definition at line 60 of file php_ini.h.

Definition at line 59 of file php_ini.h.

Definition at line 58 of file php_ini.h.

Definition at line 64 of file php_ini.h.

Definition at line 86 of file php_ini.h.

#define PHP_INI_MH   ZEND_INI_MH

Definition at line 52 of file php_ini.h.

Definition at line 45 of file php_ini.h.

Definition at line 76 of file php_ini.h.

Definition at line 77 of file php_ini.h.

Definition at line 79 of file php_ini.h.

Definition at line 78 of file php_ini.h.

Definition at line 75 of file php_ini.h.

Definition at line 74 of file php_ini.h.

Definition at line 88 of file php_ini.h.

Definition at line 46 of file php_ini.h.

Definition at line 44 of file php_ini.h.

Definition at line 69 of file php_ini.h.

Definition at line 67 of file php_ini.h.

Definition at line 68 of file php_ini.h.


Function Documentation

PHPAPI int cfg_get_double ( const char *  varname,
double *  result 
)

Definition at line 913 of file php_ini.c.

{
       zval *tmp, var;

       if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) {
              *result = (double) 0;
              return FAILURE;
       }
       var = *tmp;
       zval_copy_ctor(&var);
       convert_to_double(&var);
       *result = Z_DVAL(var);
       return SUCCESS;
}

Here is the call graph for this function:

PHPAPI zval* cfg_get_entry ( const char *  name,
uint  name_length 
)

Definition at line 881 of file php_ini.c.

{
       zval *tmp;

       if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp) == SUCCESS) {
              return tmp;
       } else {
              return NULL;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI int cfg_get_long ( const char *  varname,
long *  result 
)

Definition at line 895 of file php_ini.c.

{
       zval *tmp, var;

       if (zend_hash_find(&configuration_hash, varname, strlen(varname) + 1, (void **) &tmp) == FAILURE) {
              *result = 0;
              return FAILURE;
       }
       var = *tmp;
       zval_copy_ctor(&var);
       convert_to_long(&var);
       *result = Z_LVAL(var);
       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI int cfg_get_string ( const char *  varname,
char **  result 
)

Definition at line 931 of file php_ini.c.

{
       zval *tmp;

       if (zend_hash_find(&configuration_hash, varname, strlen(varname)+1, (void **) &tmp) == FAILURE) {
              *result = NULL;
              return FAILURE;
       }
       *result = Z_STRVAL_P(tmp);
       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI void config_zval_dtor ( zval *  zvalue)

Definition at line 192 of file php_ini.c.

{
       if (Z_TYPE_P(zvalue) == IS_ARRAY) {
              zend_hash_destroy(Z_ARRVAL_P(zvalue));
              free(Z_ARRVAL_P(zvalue));
       } else if (Z_TYPE_P(zvalue) == IS_STRING) {
              free(Z_STRVAL_P(zvalue));
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI void php_ini_activate_config ( HashTable source_hash,
int  modify_type,
int stage  TSRMLS_DC 
)

Definition at line 792 of file php_ini.c.

{
       char *str;
       zval *data;
       uint str_len;
       ulong num_index;

       /* Walk through config hash and alter matching ini entries using the values found in the hash */
       for (zend_hash_internal_pointer_reset(source_hash);
              zend_hash_get_current_key_ex(source_hash, &str, &str_len, &num_index, 0, NULL) == HASH_KEY_IS_STRING;
              zend_hash_move_forward(source_hash)
       ) {
              zend_hash_get_current_data(source_hash, (void **) &data);
              zend_alter_ini_entry_ex(str, str_len, Z_STRVAL_P(data), Z_STRLEN_P(data), modify_type, stage, 0 TSRMLS_CC);
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI void php_ini_activate_per_dir_config ( char *  path,
uint path_len  TSRMLS_DC 
)

Definition at line 820 of file php_ini.c.

{
       zval *tmp2;
       char *ptr;

#if PHP_WIN32
       char path_bak[MAXPATHLEN];
#endif

       if (path_len > MAXPATHLEN) {
              return;
       }

#if PHP_WIN32
       memcpy(path_bak, path, path_len);
       path_bak[path_len] = 0;
       TRANSLATE_SLASHES_LOWER(path_bak);
       path = path_bak;
#endif

       /* Walk through each directory in path and apply any found per-dir-system-configuration from configuration_hash */
       if (has_per_dir_config && path && path_len) {
              ptr = path + 1;
              while ((ptr = strchr(ptr, '/')) != NULL) {
                     *ptr = 0;
                     /* Search for source array matching the path from configuration_hash */
                     if (zend_hash_find(&configuration_hash, path, strlen(path) + 1, (void **) &tmp2) == SUCCESS) {
                            php_ini_activate_config(Z_ARRVAL_P(tmp2), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
                     }
                     *ptr = '/';
                     ptr++;
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI void php_ini_activate_per_host_config ( const char *  host,
uint host_len  TSRMLS_DC 
)

Definition at line 866 of file php_ini.c.

{
       zval *tmp;

       if (has_per_host_config && host && host_len) {
              /* Search for source array matching the host from configuration_hash */
              if (zend_hash_find(&configuration_hash, host, host_len, (void **) &tmp) == SUCCESS) {
                     php_ini_activate_config(Z_ARRVAL_P(tmp), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 944 of file php_ini.c.

{
       return &configuration_hash;
} /* }}} */

Definition at line 812 of file php_ini.c.

{
       return has_per_dir_config;
}

Here is the caller graph for this function:

Definition at line 858 of file php_ini.c.

{
       return has_per_host_config;
}

Here is the caller graph for this function:

Definition at line 366 of file php_ini.c.

{
       char *php_ini_file_name = NULL;
       char *php_ini_search_path = NULL;
       int php_ini_scanned_path_len;
       int safe_mode_state;
       char *open_basedir;
       int free_ini_search_path = 0;
       zend_file_handle fh;

       if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) config_zval_dtor, 1) == FAILURE) {
              return FAILURE;
       }

       if (sapi_module.ini_defaults) {
              sapi_module.ini_defaults(&configuration_hash);
       }

       zend_llist_init(&extension_lists.engine, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
       zend_llist_init(&extension_lists.functions, sizeof(char *), (llist_dtor_func_t) free_estring, 1);

       safe_mode_state = PG(safe_mode);
       open_basedir = PG(open_basedir);

       if (sapi_module.php_ini_path_override) {
              php_ini_file_name = sapi_module.php_ini_path_override;
              php_ini_search_path = sapi_module.php_ini_path_override;
              free_ini_search_path = 0;
       } else if (!sapi_module.php_ini_ignore) {
              int search_path_size;
              char *default_location;
              char *env_location;
              char *binary_location;
              static const char paths_separator[] = { ZEND_PATHS_SEPARATOR, 0 };
#ifdef PHP_WIN32
              char *reg_location;
              char phprc_path[MAXPATHLEN];
#endif

              env_location = getenv("PHPRC");

#ifdef PHP_WIN32
              if (!env_location) {
                     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("PHPRC", &dummybuf, 0);
                     if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
                            /* The environment variable doesn't exist. */
                            env_location = "";
                     } else {
                            if (size == 0) {
                                   env_location = "";
                            } else {
                                   size = GetEnvironmentVariableA("PHPRC", phprc_path, size);
                                   env_location = phprc_path;
                            }
                     }
              }
#else
              if (!env_location) {
                     env_location = "";
              }
#endif
              /*
               * Prepare search path
               */

              search_path_size = MAXPATHLEN * 4 + strlen(env_location) + 3 + 1;
              php_ini_search_path = (char *) emalloc(search_path_size);
              free_ini_search_path = 1;
              php_ini_search_path[0] = 0;

              /* Add environment location */
              if (env_location[0]) {
                     if (*php_ini_search_path) {
                            strlcat(php_ini_search_path, paths_separator, search_path_size);
                     }
                     strlcat(php_ini_search_path, env_location, search_path_size);
                     php_ini_file_name = env_location;
              }

#ifdef PHP_WIN32
              /* Add registry location */
              reg_location = GetIniPathFromRegistry();
              if (reg_location != NULL) {
                     if (*php_ini_search_path) {
                            strlcat(php_ini_search_path, paths_separator, search_path_size);
                     }
                     strlcat(php_ini_search_path, reg_location, search_path_size);
                     efree(reg_location);
              }
#endif

              /* Add cwd (not with CLI) */
              if (strcmp(sapi_module.name, "cli") != 0) {
                     if (*php_ini_search_path) {
                            strlcat(php_ini_search_path, paths_separator, search_path_size);
                     }
                     strlcat(php_ini_search_path, ".", search_path_size);
              }

              /* Add binary directory */
#ifdef PHP_WIN32
              binary_location = (char *) emalloc(MAXPATHLEN);
              if (GetModuleFileName(0, binary_location, MAXPATHLEN) == 0) {
                     efree(binary_location);
                     binary_location = NULL;
              }
#else
              if (sapi_module.executable_location) {
                     binary_location = (char *)emalloc(MAXPATHLEN);
                     if (!strchr(sapi_module.executable_location, '/')) {
                            char *envpath, *path;
                            int found = 0;

                            if ((envpath = getenv("PATH")) != NULL) {
                                   char *search_dir, search_path[MAXPATHLEN];
                                   char *last = NULL;

                                   path = estrdup(envpath);
                                   search_dir = php_strtok_r(path, ":", &last);

                                   while (search_dir) {
                                          snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location);
                                          if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) {
                                                 found = 1;
                                                 break;
                                          }
                                          search_dir = php_strtok_r(NULL, ":", &last);
                                   }
                                   efree(path);
                            }
                            if (!found) {
                                   efree(binary_location);
                                   binary_location = NULL;
                            }
                     } else if (!VCWD_REALPATH(sapi_module.executable_location, binary_location) || VCWD_ACCESS(binary_location, X_OK)) {
                            efree(binary_location);
                            binary_location = NULL;
                     }
              } else {
                     binary_location = NULL;
              }
#endif
              if (binary_location) {
                     char *separator_location = strrchr(binary_location, DEFAULT_SLASH);

                     if (separator_location && separator_location != binary_location) {
                            *(separator_location) = 0;
                     }
                     if (*php_ini_search_path) {
                            strlcat(php_ini_search_path, paths_separator, search_path_size);
                     }
                     strlcat(php_ini_search_path, binary_location, search_path_size);
                     efree(binary_location);
              }

              /* Add default location */
#ifdef PHP_WIN32
              default_location = (char *) emalloc(MAXPATHLEN + 1);

              if (0 < GetWindowsDirectory(default_location, MAXPATHLEN)) {
                     if (*php_ini_search_path) {
                            strlcat(php_ini_search_path, paths_separator, search_path_size);
                     }
                     strlcat(php_ini_search_path, default_location, search_path_size);
              }

              /* For people running under terminal services, GetWindowsDirectory will
               * return their personal Windows directory, so lets add the system
               * windows directory too */
              if (0 < GetSystemWindowsDirectory(default_location, MAXPATHLEN)) {
                     if (*php_ini_search_path) {
                            strlcat(php_ini_search_path, paths_separator, search_path_size);
                     }
                     strlcat(php_ini_search_path, default_location, search_path_size);
              }
              efree(default_location);

#else
              default_location = PHP_CONFIG_FILE_PATH;
              if (*php_ini_search_path) {
                     strlcat(php_ini_search_path, paths_separator, search_path_size);
              }
              strlcat(php_ini_search_path, default_location, search_path_size);
#endif
       }

       PG(safe_mode) = 0;
       PG(open_basedir) = NULL;

       /*
        * Find and open actual ini file
        */

       memset(&fh, 0, sizeof(fh));

       /* If SAPI does not want to ignore all ini files OR an overriding file/path is given.
        * This allows disabling scanning for ini files in the PHP_CONFIG_FILE_SCAN_DIR but still
        * load an optional ini file. */
       if (!sapi_module.php_ini_ignore || sapi_module.php_ini_path_override) {

              /* Check if php_ini_file_name is a file and can be opened */
              if (php_ini_file_name && php_ini_file_name[0]) {
                     struct stat statbuf;

                     if (!VCWD_STAT(php_ini_file_name, &statbuf)) {
                            if (!((statbuf.st_mode & S_IFMT) == S_IFDIR)) {
                                   fh.handle.fp = VCWD_FOPEN(php_ini_file_name, "r");
                                   if (fh.handle.fp) {
                                          fh.filename = php_ini_opened_path = expand_filepath(php_ini_file_name, NULL TSRMLS_CC);
                                   }
                            }
                     }
              }

              /* Otherwise search for php-%sapi-module-name%.ini file in search path */
              if (!fh.handle.fp) {
                     const char *fmt = "php-%s.ini";
                     char *ini_fname;
                     spprintf(&ini_fname, 0, fmt, sapi_module.name);
                     fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
                     efree(ini_fname);
                     if (fh.handle.fp) {
                            fh.filename = php_ini_opened_path;
                     }
              }

              /* If still no ini file found, search for php.ini file in search path */
              if (!fh.handle.fp) {
                     fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC);
                     if (fh.handle.fp) {
                            fh.filename = php_ini_opened_path;
                     }
              }
       }

       if (free_ini_search_path) {
              efree(php_ini_search_path);
       }

       PG(safe_mode) = safe_mode_state;
       PG(open_basedir) = open_basedir;

       if (fh.handle.fp) {
              fh.type = ZEND_HANDLE_FP;
              RESET_ACTIVE_INI_HASH();

              zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC);

              {
                     zval tmp;

                     Z_STRLEN(tmp) = strlen(fh.filename);
                     Z_STRVAL(tmp) = zend_strndup(fh.filename, Z_STRLEN(tmp));
                     Z_TYPE(tmp) = IS_STRING;
                     Z_SET_REFCOUNT(tmp, 0);

                     zend_hash_update(&configuration_hash, "cfg_file_path", sizeof("cfg_file_path"), (void *) &tmp, sizeof(zval), NULL);
                     if (php_ini_opened_path) {
                            efree(php_ini_opened_path);
                     }
                     php_ini_opened_path = zend_strndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
              }
       }

       /* Check for PHP_INI_SCAN_DIR environment variable to override/set config file scan directory */
       php_ini_scanned_path = getenv("PHP_INI_SCAN_DIR");
       if (!php_ini_scanned_path) {
              /* Or fall back using possible --with-config-file-scan-dir setting (defaults to empty string!) */
              php_ini_scanned_path = PHP_CONFIG_FILE_SCAN_DIR;
       }
       php_ini_scanned_path_len = strlen(php_ini_scanned_path);

       /* Scan and parse any .ini files found in scan path if path not empty. */
       if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) {
              struct dirent **namelist;
              int ndir, i;
              struct stat sb;
              char ini_file[MAXPATHLEN];
              char *p;
              zend_file_handle fh2;
              zend_llist scanned_ini_list;
              zend_llist_element *element;
              int l, total_l = 0;

              if ((ndir = php_scandir(php_ini_scanned_path, &namelist, 0, php_alphasort)) > 0) {
                     zend_llist_init(&scanned_ini_list, sizeof(char *), (llist_dtor_func_t) free_estring, 1);
                     memset(&fh2, 0, sizeof(fh2));

                     for (i = 0; i < ndir; i++) {

                            /* check for any file with .ini extension */
                            if (!(p = strrchr(namelist[i]->d_name, '.')) || (p && strcmp(p, ".ini"))) {
                                   free(namelist[i]);
                                   continue;
                            }
                            /* Reset active ini section */
                            RESET_ACTIVE_INI_HASH();

                            if (IS_SLASH(php_ini_scanned_path[php_ini_scanned_path_len - 1])) {
                                   snprintf(ini_file, MAXPATHLEN, "%s%s", php_ini_scanned_path, namelist[i]->d_name);
                            } else {
                                   snprintf(ini_file, MAXPATHLEN, "%s%c%s", php_ini_scanned_path, DEFAULT_SLASH, namelist[i]->d_name);
                            }
                            if (VCWD_STAT(ini_file, &sb) == 0) {
                                   if (S_ISREG(sb.st_mode)) {
                                          if ((fh2.handle.fp = VCWD_FOPEN(ini_file, "r"))) {
                                                 fh2.filename = ini_file;
                                                 fh2.type = ZEND_HANDLE_FP;

                                                 if (zend_parse_ini_file(&fh2, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC) == SUCCESS) {
                                                        /* Here, add it to the list of ini files read */
                                                        l = strlen(ini_file);
                                                        total_l += l + 2;
                                                        p = estrndup(ini_file, l);
                                                        zend_llist_add_element(&scanned_ini_list, &p);
                                                 }
                                          }
                                   }
                            }
                            free(namelist[i]);
                     }
                     free(namelist);

                     if (total_l) {
                            int php_ini_scanned_files_len = (php_ini_scanned_files) ? strlen(php_ini_scanned_files) + 1 : 0;
                            php_ini_scanned_files = (char *) realloc(php_ini_scanned_files, php_ini_scanned_files_len + total_l + 1);
                            if (!php_ini_scanned_files_len) {
                                   *php_ini_scanned_files = '\0';
                            }
                            total_l += php_ini_scanned_files_len;
                            for (element = scanned_ini_list.head; element; element = element->next) {
                                   if (php_ini_scanned_files_len) {
                                          strlcat(php_ini_scanned_files, ",\n", total_l);
                                   }
                                   strlcat(php_ini_scanned_files, *(char **)element->data, total_l);
                                   strlcat(php_ini_scanned_files, element->next ? ",\n" : "\n", total_l);
                            }
                     }
                     zend_llist_destroy(&scanned_ini_list);
              }
       } else {
              /* Make sure an empty php_ini_scanned_path ends up as NULL */
              php_ini_scanned_path = NULL;
       }

       if (sapi_module.ini_entries) {
              /* Reset active ini section */
              RESET_ACTIVE_INI_HASH();
              zend_parse_ini_string(sapi_module.ini_entries, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, &configuration_hash TSRMLS_CC);
       }

       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI int php_parse_user_ini_file ( const char *  dirname,
char *  ini_filename,
HashTable *target_hash  TSRMLS_DC 
)

Definition at line 760 of file php_ini.c.

{
       struct stat sb;
       char ini_file[MAXPATHLEN];
       zend_file_handle fh;

       snprintf(ini_file, MAXPATHLEN, "%s%c%s", dirname, DEFAULT_SLASH, ini_filename);

       if (VCWD_STAT(ini_file, &sb) == 0) {
              if (S_ISREG(sb.st_mode)) {
                     memset(&fh, 0, sizeof(fh));
                     if ((fh.handle.fp = VCWD_FOPEN(ini_file, "r"))) {
                            fh.filename = ini_file;
                            fh.type = ZEND_HANDLE_FP;

                            /* Reset active ini section */
                            RESET_ACTIVE_INI_HASH();

                            if (zend_parse_ini_file(&fh, 1, ZEND_INI_SCANNER_NORMAL, (zend_ini_parser_cb_t) php_ini_parser_cb, target_hash TSRMLS_CC) == SUCCESS) {
                                   /* FIXME: Add parsed file to the list of user files read? */
                                   return SUCCESS;
                            }
                            return FAILURE;
                     }
              }
       }
       return FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 731 of file php_ini.c.

Here is the call graph for this function:

Here is the caller graph for this function: