summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 11baf34c93..b98d264a3c 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -30,6 +30,7 @@
#include "zend_ini.h"
#include "zend_vm.h"
#include "zend_dtrace.h"
+#include "zend_virtual_cwd.h"
#ifdef ZTS
# define GLOBAL_FUNCTION_TABLE global_function_table
@@ -652,6 +653,8 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions TS
start_memory_manager(TSRMLS_C);
+ virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
+
#if defined(__FreeBSD__) || defined(__DragonFly__)
/* FreeBSD and DragonFly floating point precision fix */
fpsetmask(0);
@@ -802,9 +805,14 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
compiler_globals_ctor(compiler_globals, tsrm_ls);
}
free(EG(zend_constants));
+
+ virtual_cwd_deactivate(TSRMLS_C);
+
executor_globals_ctor(executor_globals, tsrm_ls);
global_persistent_list = &EG(persistent_list);
zend_copy_ini_directives(TSRMLS_C);
+#else
+ virtual_cwd_deactivate(TSRMLS_C);
#endif
}
/* }}} */
@@ -820,6 +828,9 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
zend_destroy_modules();
+ virtual_cwd_deactivate(TSRMLS_C);
+ virtual_cwd_shutdown();
+
zend_hash_destroy(GLOBAL_FUNCTION_TABLE);
zend_hash_destroy(GLOBAL_CLASS_TABLE);
@@ -910,6 +921,7 @@ ZEND_API char *get_zend_version(void) /* {{{ */
void zend_activate(TSRMLS_D) /* {{{ */
{
+ virtual_cwd_activate(TSRMLS_C);
gc_reset(TSRMLS_C);
init_compiler(TSRMLS_C);
init_executor(TSRMLS_C);