]> granicus.if.org Git - php/commitdiff
- Virtual cwd compiles now (need to uncomment #define in php.h for it to
authorAndi Gutmans <andi@php.net>
Sun, 2 Apr 2000 19:04:59 +0000 (19:04 +0000)
committerAndi Gutmans <andi@php.net>
Sun, 2 Apr 2000 19:04:59 +0000 (19:04 +0000)
  be enbaled right now).
  It seems to work very basic stuff

main/SAPI.c
main/php.h
main/php_virtual_cwd.c

index ba3f1af2517364934724741275fadd0dbefbbda6..85892b35017cc94fb271c2a7b646e9265c48bf40 100644 (file)
@@ -80,6 +80,10 @@ SAPI_API void sapi_startup(sapi_module_struct *sf)
        sapi_globals_ctor(&sapi_globals);
 #endif
 
+#ifdef VIRTUAL_DIR
+       virtual_cwd_startup(); /* Could use shutdown to free the main cwd but it would just slow it down for CGI */
+#endif
+
        reentrancy_startup();
 
        php_global_startup_internal_extensions();
index 0d84b4d7e82930fb58ce04a945410114d8ab9258..76494cbdd81f05ae1fa33730972a0dbb27f821b7 100644 (file)
@@ -284,8 +284,10 @@ PHPAPI int cfg_get_string(char *varname, char **result);
 #define PUTS_H(str)                                    php_header_write((str), strlen((str)))
 #define PUTC_H(c)                                      (php_header_write(&(c), 1), (c))
 
+/* #define VIRTUAL_DIR */
 /* Virtual current directory support */
 #ifdef VIRTUAL_DIR
+#include "php_virtual_cwd.h"
 #define PHP_GETCWD(buff, size) virtual_getcwd(buff,size)
 #define PHP_FOPEN(path, mode) virtual_fopen(path, mode)
 #define PHP_CHDIR(path) virtual_chdir(path)
index efb0ac8cf80d28b3550d7a2e2d8af2889b737c51..1c3398859b377f5751f7d45237f3825364afb9cb 100644 (file)
@@ -258,7 +258,7 @@ int virtual_file_ex(cwd_state *state, char *path, verify_path_func verify_path)
                ptr = strtok_r(NULL, TOKENIZER_STRING, &tok);
        }
 
-       if (verify_path && !verify_path(state)) {
+       if (verify_path && verify_path(state)) {
                free(state->cwd);
 
                *state = *old_state;