summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index 11baf34c93..33161f79e3 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);
@@ -908,8 +919,11 @@ ZEND_API char *get_zend_version(void) /* {{{ */
}
/* }}} */
-void zend_activate(TSRMLS_D) /* {{{ */
+ZEND_API void zend_activate(TSRMLS_D) /* {{{ */
{
+#ifdef ZTS
+ virtual_cwd_activate(TSRMLS_C);
+#endif
gc_reset(TSRMLS_C);
init_compiler(TSRMLS_C);
init_executor(TSRMLS_C);
@@ -925,7 +939,7 @@ void zend_call_destructors(TSRMLS_D) /* {{{ */
}
/* }}} */
-void zend_deactivate(TSRMLS_D) /* {{{ */
+ZEND_API void zend_deactivate(TSRMLS_D) /* {{{ */
{
/* we're no longer executing anything */
EG(opline_ptr) = NULL;