mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
- Apply realpath() cache patch. We don't use it if we're in safe_mode and
- friends (which are quite slow anyway). - If it proves to be stable I'll remove the #ifdef's in a few weeks.
This commit is contained in:
parent
01fda447c5
commit
216853c0db
4 changed files with 174 additions and 23 deletions
10
main/main.c
10
main/main.c
|
@ -322,7 +322,10 @@ PHP_INI_BEGIN()
|
|||
|
||||
STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals)
|
||||
STD_PHP_INI_BOOLEAN("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals)
|
||||
|
||||
#ifdef REALPATH_CACHE
|
||||
STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals)
|
||||
STD_PHP_INI_ENTRY("realpath_cache_ttl", "120", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals)
|
||||
#endif
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
|
||||
|
@ -1386,6 +1389,11 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
|
|||
REGISTER_INI_ENTRIES();
|
||||
zend_register_standard_ini_entries(TSRMLS_C);
|
||||
|
||||
/* Disable realpath cache if safe_mode or open_basedir are set */
|
||||
if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
|
||||
CWDG(realpath_cache_size_limit) = 0;
|
||||
}
|
||||
|
||||
/* initialize stream wrappers registry
|
||||
* (this uses configuration parameters from php.ini)
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue